From 394e8294aabf0b221c35f7a5c7bc7e4e43bc6f10 Mon Sep 17 00:00:00 2001 From: Vijay Tripathi Date: Wed, 8 Sep 2021 21:48:17 +0000 Subject: [PATCH] Fix installation of controller-gen in prowjobs (#187) Issue #, if available: Description of changes: * Fix installation of controller-gen in prowjobs * Installing controller-gen in prowjobs fail because $GOPATH/bin directory is not present. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --- scripts/install-controller-gen.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install-controller-gen.sh b/scripts/install-controller-gen.sh index 1eeef7c4..e0e62ecd 100755 --- a/scripts/install-controller-gen.sh +++ b/scripts/install-controller-gen.sh @@ -26,6 +26,8 @@ if ! is_installed controller-gen || ! k8s_controller_gen_version_equals "$CONTRO # GOBIN and GOPATH are not always set, so default to GOPATH from `go env` __GOPATH=$(go env GOPATH) __install_dir=${GOBIN:-$__GOPATH/bin} + # If __install_dir does not exist, create it + [[ -d $__install_dir ]] || mkdir -p "$__install_dir" __install_path="$__install_dir/controller-gen" __work_dir=$(mktemp -d /tmp/controller-gen-XXX)