Skip to content

Commit

Permalink
Merge pull request #3692 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…3686-to-release-1.9

[release-1.9] renaming cleanup function in ci-build-azure-ccm.sh and ci-build-kubernetes.sh
  • Loading branch information
k8s-ci-robot authored Jul 10, 2023
2 parents 4b478de + 588a17e commit 32de2a1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions hack/verify-starlark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TMP_DIR=$(mktemp -d)
OUT="${TMP_DIR}/out.log"

# cleanup on exit
cleanup() {
capz::verify-starlark::cleanup() {
ret=0
if [[ -s "${OUT}" ]]; then
echo "Found errors:"
Expand All @@ -52,7 +52,7 @@ cleanup() {
rm -rf "${TMP_DIR}"
exit ${ret}
}
trap cleanup EXIT
trap capz::verify-starlark::cleanup EXIT

BUILDIFIER="${SCRIPT_DIR}/tools/bin/buildifier/${VERSION}/buildifier"

Expand Down
5 changes: 3 additions & 2 deletions scripts/ci-build-azure-ccm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ can_reuse_artifacts() {
echo "true"
}

cleanup() {
capz::ci-build-azure-ccm::cleanup() {
echo "cloud-provider-azure cleanup"
if [[ -d "${AZURE_CLOUD_PROVIDER_ROOT:-}" ]]; then
make -C "${AZURE_CLOUD_PROVIDER_ROOT}" clean || true
fi
}

trap cleanup EXIT
trap capz::ci-build-azure-ccm::cleanup EXIT

setup
main
4 changes: 2 additions & 2 deletions scripts/ci-build-kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ can_reuse_artifacts() {
echo "true"
}

cleanup() {
capz::ci-build-kubernetes::cleanup() {
if [[ -d "${KUBE_ROOT:-}" ]]; then
make -C "${KUBE_ROOT}" clean || true
fi
}

trap cleanup EXIT
trap capz::ci-build-kubernetes::cleanup EXIT

setup
main
4 changes: 2 additions & 2 deletions scripts/ci-conformance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export WINDOWS="${WINDOWS:-false}"
# Generate SSH key.
capz::util::generate_ssh_key

cleanup() {
capz::ci-conformance::cleanup() {
"${REPO_ROOT}/hack/log/redact.sh" || true
}

trap cleanup EXIT
trap capz::ci-conformance::cleanup EXIT

if [[ "${WINDOWS}" == "true" ]]; then
make test-windows-upstream
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ export CALICO_VERSION

capz::util::generate_ssh_key

cleanup() {
capz::ci-e2e::cleanup() {
"${REPO_ROOT}/hack/log/redact.sh" || true
}

trap cleanup EXIT
trap capz::ci-e2e::cleanup EXIT
# Image is configured as `${CONTROLLER_IMG}-${ARCH}:${TAG}` where `CONTROLLER_IMG` is defaulted to `${REGISTRY}/${IMAGE_NAME}`.
if [[ "${BUILD_MANAGER_IMAGE}" == "false" ]]; then
# Load an existing image, skip docker-build and docker-push.
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ copy_secret() {
rm azure_json
}

on_exit() {
capz::ci-entrypoint::on_exit() {
if [[ -n ${KUBECONFIG:-} ]]; then
"${KUBECTL}" get nodes -o wide || echo "Unable to get nodes"
"${KUBECTL}" get pods -A -o wide || echo "Unable to get pods"
Expand All @@ -322,7 +322,7 @@ on_exit() {
# setup all required variables and images
setup

trap on_exit EXIT
trap capz::ci-entrypoint::on_exit EXIT
export ARTIFACTS="${ARTIFACTS:-${PWD}/_artifacts}"

# create cluster
Expand Down

0 comments on commit 32de2a1

Please sign in to comment.