Skip to content

Commit

Permalink
remove all vendoring
Browse files Browse the repository at this point in the history
The `vendor/` directory makes mirror maintenance unnecessarily painful.
Modern Go and modules are a cleaner, more maintainable way to manage
dependencies.

This patch removes all use of Go vendoring and updates the Makefile
targets to install dependent test tooling like `mockery` and
`git-semver` into the `_out/` directory instead of looking in a
`vendor/` directory.

Issue #293

Signed-off-by: Jay Pipes <[email protected]>
  • Loading branch information
jaypipes committed May 21, 2024
1 parent c3f09c2 commit e2a9d50
Show file tree
Hide file tree
Showing 5,143 changed files with 24 additions and 1,631,907 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ GOLANGCI_LINT_VERSION=1.54.2
GOLANGCI_LINT_BIN=$(BINDIR)/golangci-lint
GOLANGCI_LINT_VERSION_TAG=v${GOLANGCI_LINT_VERSION}

KUBELET_MOD_VERSION = $(shell go list -m -f '{{ .Version }}' k8s.io/kubelet)

.PHONY: all
all: build

Expand All @@ -38,7 +40,7 @@ build-dbg: build-tools
.PHONY: gofmt
gofmt:
@echo "Running gofmt"
gofmt -s -w `find . -path ./vendor -prune -o -type f -name '*.go' -print`
gofmt -s -w `find . -type f -name '*.go' -print`

.PHONY: govet
govet:
Expand All @@ -50,11 +52,7 @@ outdir:

.PHONY: deps-update
deps-update:
go mod tidy && go mod vendor

.PHONY: deps-clean
deps-clean:
rm -rf vendor
go mod tidy

.PHONY: binaries-all
binaries-all: outdir deps-update extra-tools build
Expand Down Expand Up @@ -140,13 +138,15 @@ _out/golangci-lint: outdir
echo "Using golangci-lint cached at $(GOLANGCI_LINT_BIN)";\
fi


_out/git-semver: outdir
@go build -o _out/git-semver vendor/github.com/mdomke/git-semver/main.go
@GOBIN=$(shell pwd)/_out go install github.com/mdomke/git-semver/[email protected]

_out/mockery: outdir
@GOBIN=$(shell pwd)/_out go install github.com/vektra/mockery/[email protected]

gen-mocks:
mockery \
--dir=vendor/k8s.io/kubelet/pkg/apis/podresources/v1 \
gen-mocks: deps-update _out/mockery
_out/mockery \
--dir=$(GOPATH)/pkg/mod/k8s.io/kubelet@$(KUBELET_MOD_VERSION)/pkg/apis/podresources/v1 \
--name=PodResourcesListerClient \
--structname=MockPodResourcesListerClient \
--filename=mock_PodResourcesListerClient.go \
Expand Down
14 changes: 13 additions & 1 deletion pkg/podres/mock_PodResourcesListerClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions vendor/github.com/OneOfOne/xxhash/.gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions vendor/github.com/OneOfOne/xxhash/.travis.yml

This file was deleted.

187 changes: 0 additions & 187 deletions vendor/github.com/OneOfOne/xxhash/LICENSE

This file was deleted.

74 changes: 0 additions & 74 deletions vendor/github.com/OneOfOne/xxhash/README.md

This file was deleted.

Loading

0 comments on commit e2a9d50

Please sign in to comment.