Skip to content

Commit

Permalink
[release-v1.12] Patch for chmod on codegen files (#950)
Browse files Browse the repository at this point in the history
* Patch for chmod on codegen files

* Execute update-cert-manager.sh by calling bash directly

Bash needs to be available otherwise both the previous and current
command will fail. We avoid calling "chmod" because that's not allowed
in CI as the CI user doesn't own the files.

* Do not print sensitive information to logs
  • Loading branch information
mgencur authored Jan 8, 2024
1 parent 3c603de commit 5c3dbf6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
5 changes: 2 additions & 3 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,5 @@ fi
"${REPO_ROOT_DIR}"/hack/update-deps.sh

cert_manager_installer="${REPO_ROOT_DIR}/vendor/knative.dev/eventing/hack/update-cert-manager.sh"
chmod +x "${cert_manager_installer}" # Allow executing cert-manager script
"${cert_manager_installer}"
chmod -x "${cert_manager_installer}" # Revert execute permissions

bash "${cert_manager_installer}"
8 changes: 6 additions & 2 deletions openshift/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ metadata:
EOF

./test/kafka/kafka_setup.sh || return $?
create_sasl_secrets || return $?
create_tls_secrets || return $?

( # Do not leak sensitive information to logs.
set +x
create_sasl_secrets || return $?
create_tls_secrets || return $?
)

KNATIVE_EVENTING_KAFKA_BROKER_MANIFESTS_DIR="$(pwd)/openshift/release/artifacts"
export KNATIVE_EVENTING_KAFKA_BROKER_MANIFESTS_DIR
Expand Down
12 changes: 12 additions & 0 deletions openshift/patches/chmod-codegen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/vendor/knative.dev/hack/codegen-library.sh b/vendor/knative.dev/hack/codegen-library.sh
index d9cf1ce7e..0f21d457e 100644
--- a/vendor/knative.dev/hack/codegen-library.sh
+++ b/vendor/knative.dev/hack/codegen-library.sh
@@ -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
1 change: 1 addition & 0 deletions openshift/release/generate-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -euo pipefail
source $(dirname $0)/resolve.sh

GITHUB_ACTIONS=true $(dirname $0)/../../hack/update-codegen.sh
git apply openshift/patches/chmod-codegen.patch

# Eventing core will bring the config tracing ConfigMap, so remove it from heret
rm -f control-plane/config/eventing-kafka-broker/200-controller/100-config-tracing.yaml
Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/hack/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 5c3dbf6

Please sign in to comment.