Skip to content

Commit

Permalink
chore: Install toolchain files to location provided in KUBEBUILDER_AS…
Browse files Browse the repository at this point in the history
…SETS if set (#7238)
  • Loading branch information
javanthropus authored Mar 6, 2025
1 parent 81fe97e commit 0159dd5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions hack/toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
set -euo pipefail

K8S_VERSION="${K8S_VERSION:="1.29.x"}"
KUBEBUILDER_ASSETS="/usr/local/kubebuilder/bin"
KUBEBUILDER_ASSETS="${KUBEBUILDER_ASSETS:-/usr/local/kubebuilder/bin}"


main() {
tools
Expand Down Expand Up @@ -32,10 +33,12 @@ tools() {
}

kubebuilder() {
sudo mkdir -p ${KUBEBUILDER_ASSETS}
sudo chown "${USER}" ${KUBEBUILDER_ASSETS}
if ! mkdir -p ${KUBEBUILDER_ASSETS}; then
sudo mkdir -p ${KUBEBUILDER_ASSETS}
sudo chown $(whoami) ${KUBEBUILDER_ASSETS}
fi
arch=$(go env GOARCH)
ln -sf "$(setup-envtest use -p path "${K8S_VERSION}" --arch="${arch}" --bin-dir="${KUBEBUILDER_ASSETS}")"/* ${KUBEBUILDER_ASSETS}
ln -sf $(setup-envtest use -p path "${K8S_VERSION}" --arch="${arch}" --bin-dir="${KUBEBUILDER_ASSETS}")/* ${KUBEBUILDER_ASSETS}
find $KUBEBUILDER_ASSETS

# Install latest binaries for 1.25.x (contains CEL fix)
Expand Down

0 comments on commit 0159dd5

Please sign in to comment.