Skip to content

Commit

Permalink
Merge pull request #831 from jackfrancis/sudo-optional
Browse files Browse the repository at this point in the history
chore: fallback to sudo
  • Loading branch information
k8s-ci-robot authored Nov 30, 2023
2 parents 79dc345 + 25531cc commit d940f18
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hack/toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d940f18

Please sign in to comment.