diff --git a/build/root/Makefile b/build/root/Makefile index f5cb0774052..401b8c44f45 100644 --- a/build/root/Makefile +++ b/build/root/Makefile @@ -46,12 +46,15 @@ GENERATED_FILE_PREFIX := zz_generated. # Metadata for driving the build lives here. META_DIR := .make -# Our build flags. -# TODO(thockin): it would be nice to just use the native flags. Can we EOL -# these "wrapper" flags? -KUBE_GOFLAGS := $(GOFLAGS) -KUBE_GOLDFLAGS := $(GOLDFLAGS) -KUBE_GOGCFLAGS = $(GOGCFLAGS) +ifdef KUBE_GOFLAGS +$(info KUBE_GOFLAGS is now deprecated. Please use GOFLAGS instead.) +ifndef GOFLAGS +GOFLAGS := $(KUBE_GOFLAGS) +unexport KUBE_GOFLAGS +else +$(error Both KUBE_GOFLAGS and GOFLAGS are set. Please use just GOFLAGS) +endif +endif # Extra options for the release or quick-release options: KUBE_RELEASE_RUN_TESTS := $(KUBE_RELEASE_RUN_TESTS) diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index a2d2635a5f5..e1a55073b89 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -624,9 +624,9 @@ kube::golang::build_binaries() { # Use eval to preserve embedded quoted strings. local goflags goldflags gogcflags - eval "goflags=(${KUBE_GOFLAGS:-})" - goldflags="${KUBE_GOLDFLAGS:-} $(kube::version::ldflags)" - gogcflags="${KUBE_GOGCFLAGS:-}" + eval "goflags=(${GOFLAGS:-})" + goldflags="${GOLDFLAGS:-} $(kube::version::ldflags)" + gogcflags="${GOGCFLAGS:-}" local use_go_build local -a targets=() diff --git a/hack/make-rules/test-integration.sh b/hack/make-rules/test-integration.sh index 1b7d9803199..dbe7efc3616 100755 --- a/hack/make-rules/test-integration.sh +++ b/hack/make-rules/test-integration.sh @@ -70,7 +70,7 @@ runTests() { KUBE_RACE="-race" make -C "${KUBE_ROOT}" test \ WHAT="${WHAT:-$(kube::test::find_integration_test_dirs | paste -sd' ' -)}" \ - KUBE_GOFLAGS="${KUBE_GOFLAGS:-}" \ + GOFLAGS="${GOFLAGS:-}" \ KUBE_TEST_ARGS="${KUBE_TEST_ARGS:-} ${SHORT:--short=true} --vmodule=garbage*collector*=6 --alsologtostderr=true" \ KUBE_RACE="" \ KUBE_TIMEOUT="${KUBE_TIMEOUT}" \ diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh index 399b367419d..6d4cc2c748a 100755 --- a/hack/make-rules/test.sh +++ b/hack/make-rules/test.sh @@ -168,7 +168,7 @@ done shift $((OPTIND - 1)) # Use eval to preserve embedded quoted strings. -eval "goflags=(${KUBE_GOFLAGS:-})" +eval "goflags=(${GOFLAGS:-})" eval "testargs=(${KUBE_TEST_ARGS:-})" # Used to filter verbose test output. diff --git a/hack/make-rules/vet.sh b/hack/make-rules/vet.sh index b93b91eb335..0b6efb05184 100755 --- a/hack/make-rules/vet.sh +++ b/hack/make-rules/vet.sh @@ -36,7 +36,7 @@ fi go install ./cmd/... # Use eval to preserve embedded quoted strings. -eval "goflags=(${KUBE_GOFLAGS:-})" +eval "goflags=(${GOFLAGS:-})" # Filter out arguments that start with "-" and move them to goflags. targets=() diff --git a/hack/test-integration.sh b/hack/test-integration.sh index 57f4eead099..ad928e03ffe 100755 --- a/hack/test-integration.sh +++ b/hack/test-integration.sh @@ -28,6 +28,6 @@ echo "The following invocation will run all integration tests: " echo ' make test-integration' echo echo "The following invocation will run a specific test with the verbose flag set: " -echo ' make test-integration WHAT=./test/integration/pods KUBE_GOFLAGS="-v" KUBE_TEST_ARGS="-run ^TestPodUpdateActiveDeadlineSeconds$"' +echo ' make test-integration WHAT=./test/integration/pods GOFLAGS="-v" KUBE_TEST_ARGS="-run ^TestPodUpdateActiveDeadlineSeconds$"' echo exit 1