Skip to content

Commit

Permalink
Change the build_binaries path to use modules
Browse files Browse the repository at this point in the history
This makes "new" and "old" setup_env functions. In subsequent commits,
all callers of the "old" form will be fixed, and the "new" will be
renamed back.

The old and new functions diff:

```diff
--- /tmp/old	2023-05-06 12:03:23.913951720 -0700
+++ /tmp/new	2023-05-06 12:06:37.688300514 -0700
--- a	2023-05-27 10:20:55.477856825 -0700
+++ b	2023-05-27 10:23:13.253192669 -0700
@@ -1,4 +1,4 @@
-kube::golang::old::setup_env() {
+kube::golang::new::setup_env() {
   kube::golang::verify_go_version

   # Set up GOPATH.  We have tools which depend on being in a GOPATH (see
@@ -7,9 +7,9 @@
   # Even in module mode, we need to set GOPATH for `go build` and `go install`
   # to work.  We build various tools (usually via `go install`) from a lot of
   # scripts.
-  #   * We can't set GOBIN because that does not work on cross-compiles.
-  #   * We could use `go build -o <something>`, but it's subtle when it comes
-  #     to cross-compiles and whether the <something> is a file or a directory,
+  #   * We can't just set GOBIN because that does not work on cross-compiles.
+  #   * We could always use `go build -o <something>`, but it's subtle wrt
+  #     cross-compiles and whether the <something> is a file or a directory,
   #     and EVERY caller has to get it *just* right.
   #   * We could leave GOPATH alone and let `go install` write binaries
   #     wherever the user's GOPATH says (or doesn't say).
@@ -20,7 +20,6 @@
   #
   # Eventually, when we no longer rely on run-in-gopath.sh we may be able to
   # simplify this some.
-  kube::golang::old::create_gopath_tree
   export GOPATH="${KUBE_GOPATH}"

   # If these are not set, set them now.  This ensures that any subsequent
@@ -31,23 +30,12 @@
   # Make sure our own Go binaries are in PATH.
   export PATH="${KUBE_GOPATH}/bin:${PATH}"

-  # Change directories so that we are within the GOPATH.  Some tools get really
-  # upset if this is not true.  We use a whole fake GOPATH here to collect the
-  # resultant binaries.
-  local subdir
-  subdir=$(kube::realpath . | sed "s|${KUBE_ROOT}||")
-  cd "${KUBE_GOPATH}/src/${KUBE_GO_PACKAGE}/${subdir}" || return 1
-
-  # Set GOROOT so binaries that parse code can work properly.
-  GOROOT=$(go env GOROOT)
-  export GOROOT
-
   # Unset GOBIN in case it already exists in the current session.
   # Cross-compiles will not work with it set.
   unset GOBIN

-  # This seems to matter to some tools
-  export GO15VENDOREXPERIMENT=1
+  # Explicitly turn on modules.
+  export GO111MODULE=on

   # GOMAXPROCS by default does not reflect the number of cpu(s) available
   # when running in a container, please see golang/go#33803
@@ -58,8 +46,6 @@
     # shellcheck disable=SC2164
     popd >/dev/null
   fi
-
-  GOMAXPROCS=${GOMAXPROCS:-$(ncpu)}
-  export GOMAXPROCS
-  kube::log::status "Setting GOMAXPROCS: ${GOMAXPROCS}"
+  export GOMAXPROCS=${GOMAXPROCS:-$(ncpu)}
+  V=3 kube::log::status "Setting GOMAXPROCS: ${GOMAXPROCS}"
 }
```

Result: `make` works for k/k:

```
$ make kubectl
+++ [1211 11:07:31] Building go targets for linux/amd64
    k8s.io/kubernetes/cmd/kubectl (static)

$ make WHAT=./cmd/kubectl/
+++ [1211 11:08:19] Building go targets for linux/amd64
    k8s.io/kubernetes/./cmd/kubectl/ (non-static)

$ make WHAT=k8s.io/kubernetes/cmd/kubectl
+++ [1211 11:08:52] Building go targets for linux/amd64
    k8s.io/kubernetes/cmd/kubectl (static)
```

Result: `make` works for stagin by package:

```
$ make WHAT=k8s.io/api
+++ [1211 11:11:37] Building go targets for linux/amd64
    k8s.io/api (non-static)
```

Result: `make` fails for staging by path:

```
$ make WHAT=./staging/src/k8s.io/api
+++ [1211 11:12:44] Building go targets for linux/amd64
    k8s.io/kubernetes/./staging/src/k8s.io/api (non-static)
cannot find module providing package k8s.io/kubernetes/staging/src/k8s.io/api: import lookup disabled by -mod=vendor
	(Go version in go.work is at least 1.14 and vendor directory exists.)
!!! [1211 11:12:44] Call tree:
!!! [1211 11:12:44]  1: /home/thockin/src/kubernetes/hack/lib/golang.sh:850 kube::golang::build_some_binaries(...)
!!! [1211 11:12:44]  2: /home/thockin/src/kubernetes/hack/lib/golang.sh:1012 kube::golang::build_binaries_for_platform(...)
!!! [1211 11:12:44]  3: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [1211 11:12:44] Call tree:
!!! [1211 11:12:44]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [1211 11:12:44] Call tree:
!!! [1211 11:12:44]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make: *** [Makefile:96: all] Error 1
```

Result: `make test` fails:

```
$ make test WHAT=./cmd/kubectl
+++ [1211 11:13:38] Set GOMAXPROCS automatically to 6
+++ [1211 11:13:38] Running tests without code coverage and with -race
cmd/kubectl/kubectl.go:25:2: cannot find package "k8s.io/client-go/plugin/pkg/client/auth" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/client-go/plugin/pkg/client/auth (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/client-go/plugin/pkg/client/auth (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/client-go/plugin/pkg/client/auth (from $GOPATH)
cmd/kubectl/kubectl.go:20:2: cannot find package "k8s.io/component-base/cli" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/component-base/cli (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/component-base/cli (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/component-base/cli (from $GOPATH)
cmd/kubectl/kubectl.go:21:2: cannot find package "k8s.io/kubectl/pkg/cmd" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/kubectl/pkg/cmd (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubectl/pkg/cmd (from $GOPATH)
cmd/kubectl/kubectl.go:22:2: cannot find package "k8s.io/kubectl/pkg/cmd/util" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/util (vendor tree)
	/home/thockin/sdk/gotip/src/k8s.io/kubectl/pkg/cmd/util (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubectl/pkg/cmd/util (from $GOPATH)
make: *** [Makefile:191: test] Error 1
```
  • Loading branch information
thockin committed Dec 12, 2023
1 parent 76f6661 commit 75a3111
Show file tree
Hide file tree
Showing 27 changed files with 91 additions and 37 deletions.
74 changes: 64 additions & 10 deletions hack/lib/golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ kube::golang::set_platform_envs() {
}

# Create the GOPATH tree under $KUBE_OUTPUT
kube::golang::create_gopath_tree() {
#FIXME: remove this when kube::golang::old::setup_env() is removed
kube::golang::old::create_gopath_tree() {
local go_pkg_dir="${KUBE_GOPATH}/src/${KUBE_GO_PACKAGE}"
local go_pkg_basedir
go_pkg_basedir=$(dirname "${go_pkg_dir}")
Expand Down Expand Up @@ -508,7 +509,7 @@ EOF
fi
}

# kube::golang::setup_env will check that the `go` commands is available in
# kube::golang::old::setup_env will check that the `go` commands is available in
# ${PATH}. It will also check that the Go version is good enough for the
# Kubernetes build.
#
Expand All @@ -517,7 +518,8 @@ EOF
# env-var GOBIN is unset (we want binaries in a predictable place)
# env-var GO15VENDOREXPERIMENT=1
# current directory is within GOPATH
kube::golang::setup_env() {
#FIXME: remove this when all callers are converted
kube::golang::old::setup_env() {
kube::golang::verify_go_version

# Set up GOPATH. We have tools which depend on being in a GOPATH (see
Expand All @@ -539,7 +541,7 @@ kube::golang::setup_env() {
#
# Eventually, when we no longer rely on run-in-gopath.sh we may be able to
# simplify this some.
kube::golang::create_gopath_tree
kube::golang::old::create_gopath_tree
export GOPATH="${KUBE_GOPATH}"

# If these are not set, set them now. This ensures that any subsequent
Expand Down Expand Up @@ -569,6 +571,55 @@ kube::golang::setup_env() {
export GO15VENDOREXPERIMENT=1
}

# kube::golang::new::setup_env will check that the `go` commands is available in
# ${PATH}. It will also check that the Go version is good enough for the
# Kubernetes build.
#
# Outputs:
# env-var GOPATH points to our local output dir
# env-var GOBIN is unset (we want binaries in a predictable place)
# env-var PATH includes the local GOPATH
#FIXME: rename this when all callers are converted
kube::golang::new::setup_env() {
kube::golang::verify_go_version

# Set up GOPATH. We have tools which depend on being in a GOPATH (see
# hack/run-in-gopath.sh).
#
# Even in module mode, we need to set GOPATH for `go build` and `go install`
# to work. We build various tools (usually via `go install`) from a lot of
# scripts.
# * We can't just set GOBIN because that does not work on cross-compiles.
# * We could always use `go build -o <something>`, but it's subtle wrt
# cross-compiles and whether the <something> is a file or a directory,
# and EVERY caller has to get it *just* right.
# * We could leave GOPATH alone and let `go install` write binaries
# wherever the user's GOPATH says (or doesn't say).
#
# Instead we set it to a phony local path and process the results ourselves.
# In particular, GOPATH[0]/bin will be used for `go install`, with
# cross-compiles adding an extra directory under that.
#
# Eventually, when we no longer rely on run-in-gopath.sh we may be able to
# simplify this some.
export GOPATH="${KUBE_GOPATH}"

# If these are not set, set them now. This ensures that any subsequent
# scripts we run (which may call this function again) use the same values.
export GOCACHE="${GOCACHE:-"${KUBE_GOPATH}/cache/build"}"
export GOMODCACHE="${GOMODCACHE:-"${KUBE_GOPATH}/cache/mod"}"

# Make sure our own Go binaries are in PATH.
export PATH="${KUBE_GOPATH}/bin:${PATH}"

# Unset GOBIN in case it already exists in the current session.
# Cross-compiles will not work with it set.
unset GOBIN

# Explicitly turn on modules.
export GO111MODULE=on
}

kube::golang::setup_gomaxprocs() {
# GOMAXPROCS by default does not reflect the number of cpu(s) available
# when running in a container, please see https://github.com/golang/go/issues/33803
Expand Down Expand Up @@ -737,14 +788,14 @@ kube::golang::build_some_binaries() {
done
if [[ "${#uncovered[@]}" != 0 ]]; then
V=2 kube::log::info "Building ${uncovered[*]} without coverage..."
GO111MODULE=on GOPROXY=off go install "${build_args[@]}" "${uncovered[@]}"
GOPROXY=off go install "${build_args[@]}" "${uncovered[@]}"
else
V=2 kube::log::info "Nothing to build without coverage."
fi
else
fi
else
V=2 kube::log::info "Coverage is disabled."
GO111MODULE=on GOPROXY=off go install "${build_args[@]}" "$@"
fi
GOPROXY=off go install "${build_args[@]}" "$@"
fi
}

# Args:
Expand Down Expand Up @@ -856,7 +907,7 @@ kube::golang::build_binaries() {
# Create a sub-shell so that we don't pollute the outer environment
(
# Check for `go` binary and set ${GOPATH}.
kube::golang::setup_env
kube::golang::new::setup_env
V=2 kube::log::info "Go version: $(GOFLAGS='' go version)"

local host_platform
Expand All @@ -867,6 +918,9 @@ kube::golang::build_binaries() {
# build_binaries_for_platform.
local goflags goldflags goasmflags gogcflags gotags

# FIXME: decide if we need this or not
goflags+=("-modcacherw") # since we keep GOMODCACHE locally

# This is $(pwd) because we use run-in-gopath to build. Once that is
# excised, this can become ${KUBE_ROOT}.
local trimroot # two lines to appease shellcheck SC2155
Expand Down
2 changes: 1 addition & 1 deletion hack/lib/protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PROTOC_VERSION=23.4
# and formats it correctly
# $1: Full path to the directory where the api.proto file is
function kube::protoc::generate_proto() {
kube::golang::setup_env
kube::golang::old::setup_env
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo

kube::protoc::check_protoc
Expand Down
2 changes: 1 addition & 1 deletion hack/lib/verify-generated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ kube::verify::generated() {
kube::util::ensure_clean_working_dir

# This sets up the environment, like GOCACHE, which keeps the worktree cleaner.
kube::golang::setup_env
kube::golang::old::setup_env

_tmpdir="$(kube::realpath "$(mktemp -d -t "verify-generated-$(basename "$1").XXXXXX")")"
git worktree add -f -q "${_tmpdir}" HEAD
Expand Down
2 changes: 1 addition & 1 deletion hack/make-rules/test-e2e-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env
kube::golang::setup_gomaxprocs

# start the cache mutation detector by default so that cache mutators will be found
Expand Down
2 changes: 1 addition & 1 deletion hack/make-rules/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env
kube::golang::setup_gomaxprocs

# start the cache mutation detector by default so that cache mutators will be found
Expand Down
2 changes: 1 addition & 1 deletion hack/run-in-gopath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

# This sets up a clean GOPATH and makes sure we are currently in it.
kube::golang::setup_env
kube::golang::old::setup_env

# Run the user-provided command.
"${@}"
2 changes: 1 addition & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
source "${KUBE_ROOT}/hack/lib/protoc.sh"
cd "${KUBE_ROOT}"

kube::golang::setup_env
kube::golang::old::setup_env

DBG_CODEGEN="${DBG_CODEGEN:-0}"
GENERATED_FILE_PREFIX="${GENERATED_FILE_PREFIX:-zz_generated.}"
Expand Down
2 changes: 1 addition & 1 deletion hack/update-generated-api-compatibility-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env

# run in module mode to match test command in readme.md
export GO111MODULE=on
Expand Down
2 changes: 1 addition & 1 deletion hack/update-generated-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env

BINS=(
cmd/gendocs
Expand Down
2 changes: 1 addition & 1 deletion hack/update-generated-protobuf-dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
source "${KUBE_ROOT}/hack/lib/protoc.sh"

kube::protoc::check_protoc
kube::golang::setup_env
kube::golang::old::setup_env

GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
Expand Down
2 changes: 1 addition & 1 deletion hack/update-go-workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

# This sets up the environment, like GOCACHE, which keeps the worktree cleaner.
kube::golang::setup_env
kube::golang::new::setup_env
export GO111MODULE=on # TODO(thockin): remove this when it's the default

cd "${KUBE_ROOT}"
Expand Down
2 changes: 1 addition & 1 deletion hack/update-golangci-lint-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

# This sets up the environment, like GOCACHE, which keeps the worktree cleaner.
kube::golang::setup_env
kube::golang::old::setup_env

# Remove all files, some of them might be obsolete.
rm -f hack/golangci*.yaml
Expand Down
2 changes: 1 addition & 1 deletion hack/update-mocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
export GO111MODULE=on

kube::golang::verify_go_version
kube::golang::setup_env
kube::golang::old::setup_env

echo 'installing mockgen'
pushd "${KUBE_ROOT}/hack/tools" >/dev/null
Expand Down
4 changes: 2 additions & 2 deletions hack/update-openapi-spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ OPENAPI_ROOT_DIR="${KUBE_ROOT}/api/openapi-spec"
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::util::require-jq
kube::golang::setup_env
kube::golang::old::setup_env

make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver

Expand All @@ -46,7 +46,7 @@ function cleanup()

trap cleanup EXIT SIGINT

kube::golang::setup_env
kube::golang::old::setup_env

TMP_DIR=${TMP_DIR:-$(kube::realpath "$(mktemp -d -t "$(basename "$0").XXXXXX")")}
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
Expand Down
2 changes: 1 addition & 1 deletion hack/update-yamlfmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env

cd "${KUBE_ROOT}"

Expand Down
2 changes: 1 addition & 1 deletion hack/verify-cli-conventions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env

BINS=(
cmd/clicheck
Expand Down
2 changes: 1 addition & 1 deletion hack/verify-description.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
source "${KUBE_ROOT}/hack/lib/util.sh"

kube::golang::setup_env
kube::golang::old::setup_env

make -C "${KUBE_ROOT}" WHAT=cmd/genswaggertypedocs

Expand Down
2 changes: 1 addition & 1 deletion hack/verify-fieldname-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
source "${KUBE_ROOT}/hack/lib/util.sh"

kube::golang::setup_env
kube::golang::old::setup_env

make -C "${KUBE_ROOT}" WHAT=cmd/fieldnamedocscheck

Expand Down
2 changes: 1 addition & 1 deletion hack/verify-generated-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env

BINS=(
cmd/gendocs
Expand Down
2 changes: 1 addition & 1 deletion hack/verify-gofmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"

cd "${KUBE_ROOT}"

kube::golang::setup_env
kube::golang::old::setup_env

find_files() {
find . -not \( \
Expand Down
2 changes: 1 addition & 1 deletion hack/verify-govulncheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ source "${KUBE_ROOT}/hack/lib/util.sh"
kube::util::ensure_clean_working_dir

# This sets up the environment, like GOCACHE, which keeps the worktree cleaner.
kube::golang::setup_env
kube::golang::old::setup_env
# Opt into using go modules
export GO111MODULE=on

Expand Down
2 changes: 1 addition & 1 deletion hack/verify-import-boss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env

GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/import-boss

Expand Down
2 changes: 1 addition & 1 deletion hack/verify-imports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env

make -C "${KUBE_ROOT}" WHAT=cmd/importverifier

Expand Down
2 changes: 1 addition & 1 deletion hack/verify-licenses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
source "${KUBE_ROOT}/hack/lib/util.sh"

# This sets up the environment, like GOCACHE, which keeps the worktree cleaner.
kube::golang::setup_env
kube::golang::old::setup_env
kube::util::ensure-temp-dir

# Creating a new repository tree
Expand Down
2 changes: 1 addition & 1 deletion hack/verify-openapi-spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env
kube::etcd::install

make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver
Expand Down
2 changes: 1 addition & 1 deletion test/instrumentation/stability-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stability_check_setup() {
kube::golang::verify_go_version
kube::util::ensure-temp-dir
cd "${KUBE_ROOT}"
kube::golang::setup_env
kube::golang::old::setup_env
}

function find_files_to_check() {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/ipamperf/test-performance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ done
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../../../
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::golang::old::setup_env

DIR_BASENAME=$(dirname "${BASH_SOURCE[0]}")
pushd "${DIR_BASENAME}"
Expand Down

0 comments on commit 75a3111

Please sign in to comment.