-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean the GO mod files by removing the unnecessary indirect imports #1454
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:master
from
camilamacedo86:clean-imports
Apr 13, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -20,6 +20,13 @@ | |
export GOPROXY?=https://proxy.golang.org/ | ||
CONTROLLER_GEN_BIN_PATH := $(shell which controller-gen) | ||
|
||
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) | ||
ifeq (,$(shell go env GOBIN)) | ||
GOBIN=$(shell go env GOPATH)/bin | ||
else | ||
GOBIN=$(shell go env GOBIN) | ||
endif | ||
|
||
##@ General | ||
|
||
# The help will print out all targets with their descriptions organized bellow their categories. The categories are represented by `##@` and the target descriptions by `##`. | ||
|
@@ -45,7 +52,9 @@ install: ## Build and install the binary with the current source code. Use it to | |
|
||
.PHONY: generate | ||
generate: ## Update/generate all mock data. You should run this commands to update the mock data after your changes. | ||
make generate-setup | ||
# If exists, rremove the controller-gen installed locally. It ensures that the version which will be used | ||
# is the version defined in the Makefile scaffolded. | ||
- rm -rf $(CONTROLLER_GEN_BIN_PATH) | ||
make generate-testdata | ||
go mod tidy | ||
|
||
|
@@ -57,11 +66,6 @@ generate-testdata: ## Update/generate the testdata in $GOPATH/src/sigs.k8s.io/ku | |
generate-vendor: ## (Deprecated) Update/generate the vendor by using the path $GOPATH/src/sigs.k8s.io/kubebuilder-test | ||
GO111MODULE=off ./generate_vendor.sh | ||
|
||
.PHONY: generate-setup | ||
generate-setup: ## Current workarround to generate the testdata with the correct controller-gen version | ||
- rm -rf $(CONTROLLER_GEN_BIN_PATH) | ||
- GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/[email protected] | ||
|
||
.PHONY: lint | ||
lint: ## Run code lint checks | ||
./scripts/verify.sh | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to remove this section. I imagine that what you can do here is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makefile target was added just to ensure that the correct version will be used.
Note that we just need to remove any pre-existent installation to ensure that. And then, the defined version in the makefile which will be scaffolded will be installed and used. So, it is not required at all and because of this, I keep just the rm -rf line and did not the tmp dir. See: https://github.com/kubernetes-sigs/kubebuilder/pull/1454/files#diff-b67911656ef5d18c4ae36cb6741b7965R57 Is it make sense?