-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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: | ||
|
@@ -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 | ||
|
@@ -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 \ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.