Skip to content

Commit 0fdc8f6

Browse files
authored
Merge pull request #3697 from k8s-infra-cherrypick-robot/cherry-pick-3686-to-release-1.8
[release-1.8] renaming cleanup function in ci-build-azure-ccm.sh and ci-build-kubernetes.sh
2 parents c055c99 + 430d43f commit 0fdc8f6

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

hack/verify-starlark.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ TMP_DIR=$(mktemp -d)
3939
OUT="${TMP_DIR}/out.log"
4040

4141
# cleanup on exit
42-
cleanup() {
42+
capz::verify-starlark::cleanup() {
4343
ret=0
4444
if [[ -s "${OUT}" ]]; then
4545
echo "Found errors:"
@@ -52,7 +52,7 @@ cleanup() {
5252
rm -rf "${TMP_DIR}"
5353
exit ${ret}
5454
}
55-
trap cleanup EXIT
55+
trap capz::verify-starlark::cleanup EXIT
5656

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

scripts/ci-build-azure-ccm.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,14 @@ can_reuse_artifacts() {
9090
echo "true"
9191
}
9292

93-
cleanup() {
93+
capz::ci-build-azure-ccm::cleanup() {
94+
echo "cloud-provider-azure cleanup"
9495
if [[ -d "${AZURE_CLOUD_PROVIDER_ROOT:-}" ]]; then
9596
make -C "${AZURE_CLOUD_PROVIDER_ROOT}" clean || true
9697
fi
9798
}
9899

99-
trap cleanup EXIT
100+
trap capz::ci-build-azure-ccm::cleanup EXIT
100101

101102
setup
102103
main

scripts/ci-build-kubernetes.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ can_reuse_artifacts() {
152152
echo "true"
153153
}
154154

155-
cleanup() {
155+
capz::ci-build-kubernetes::cleanup() {
156156
if [[ -d "${KUBE_ROOT:-}" ]]; then
157157
make -C "${KUBE_ROOT}" clean || true
158158
fi
159159
}
160160

161-
trap cleanup EXIT
161+
trap capz::ci-build-kubernetes::cleanup EXIT
162162

163163
setup
164164
main

scripts/ci-conformance.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ export WINDOWS="${WINDOWS:-false}"
7878
# Generate SSH key.
7979
capz::util::generate_ssh_key
8080

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

85-
trap cleanup EXIT
85+
trap capz::ci-conformance::cleanup EXIT
8686

8787
if [[ "${WINDOWS}" == "true" ]]; then
8888
make test-windows-upstream

scripts/ci-e2e.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ export CALICO_VERSION
7777

7878
capz::util::generate_ssh_key
7979

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

84-
trap cleanup EXIT
84+
trap capz::ci-e2e::cleanup EXIT
8585
# Image is configured as `${CONTROLLER_IMG}-${ARCH}:${TAG}` where `CONTROLLER_IMG` is defaulted to `${REGISTRY}/${IMAGE_NAME}`.
8686
if [[ "${BUILD_MANAGER_IMAGE}" == "false" ]]; then
8787
# Load an existing image, skip docker-build and docker-push.

scripts/ci-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ copy_secret() {
304304
rm azure_json
305305
}
306306

307-
on_exit() {
307+
capz::ci-entrypoint::on_exit() {
308308
if [[ -n ${KUBECONFIG:-} ]]; then
309309
"${KUBECTL}" get nodes -o wide || echo "Unable to get nodes"
310310
"${KUBECTL}" get pods -A -o wide || echo "Unable to get pods"
@@ -324,7 +324,7 @@ on_exit() {
324324
# setup all required variables and images
325325
setup
326326

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

330330
# create cluster

0 commit comments

Comments
 (0)