Skip to content

Commit 394e829

Browse files
authored
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.
1 parent 1e058d0 commit 394e829

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/install-controller-gen.sh

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ if ! is_installed controller-gen || ! k8s_controller_gen_version_equals "$CONTRO
2626
# GOBIN and GOPATH are not always set, so default to GOPATH from `go env`
2727
__GOPATH=$(go env GOPATH)
2828
__install_dir=${GOBIN:-$__GOPATH/bin}
29+
# If __install_dir does not exist, create it
30+
[[ -d $__install_dir ]] || mkdir -p "$__install_dir"
2931
__install_path="$__install_dir/controller-gen"
3032
__work_dir=$(mktemp -d /tmp/controller-gen-XXX)
3133

0 commit comments

Comments
 (0)