Skip to content

Commit

Permalink
Make generate-groups.sh and generate-knative.sh executable conditiona…
Browse files Browse the repository at this point in the history
…lly (#338)

The codegen-library.sh script might be executed within a container that
doesn't run as root in which case changing permissions is not allowed
and the whole scripts fails.
This change gives opportunity to set the permissions in advance (e.g.
during docker build) and then run this script successfully.
  • Loading branch information
mgencur authored Oct 25, 2023
1 parent 2c938d4 commit d4af42e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codegen-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export GOBIN=${GOPATH}/bin # Set GOBIN explicitly as deepcopy-gen is installed b
export CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
export KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/knative.dev/pkg 2>/dev/null || echo "${REPO_ROOT_DIR}")}

chmod +x ${CODEGEN_PKG}/generate-groups.sh
chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh
[ -x ${CODEGEN_PKG}/generate-groups.sh ] || chmod +x ${CODEGEN_PKG}/generate-groups.sh
[ -x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh ] || chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh

0 comments on commit d4af42e

Please sign in to comment.