From 25531cc9413bc84ab2376047f27ce8d0aee2f693 Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Wed, 29 Nov 2023 12:42:54 -0800 Subject: [PATCH] chore: fallback to sudo Signed-off-by: Jack Francis --- hack/toolchain.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hack/toolchain.sh b/hack/toolchain.sh index a95371552..490fd80be 100755 --- a/hack/toolchain.sh +++ b/hack/toolchain.sh @@ -30,8 +30,10 @@ tools() { } kubebuilder() { - sudo mkdir -p /usr/local/kubebuilder/bin - sudo chown "${USER}" /usr/local/kubebuilder/bin + 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} find $KUBEBUILDER_ASSETS