From 581efb3602eb532dc9dd03483e274dbcfacfc840 Mon Sep 17 00:00:00 2001 From: Riya Singhal Date: Wed, 3 Jan 2024 23:14:51 +0530 Subject: [PATCH 1/9] ci: update mergify rules for kubernetes 1.29 Signed-off-by: Riya Singhal --- .mergify.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 935e40cc1b9..48086e3abf5 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -75,12 +75,15 @@ queue_rules: - "status-success=ci/centos/k8s-e2e-external-storage/1.26" - "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.28" + - "status-success=ci/centos/k8s-e2e-external-storage/1.29" - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.29" - "status-success=ci/centos/mini-e2e/k8s-1.26" - "status-success=ci/centos/mini-e2e/k8s-1.27" - "status-success=ci/centos/mini-e2e/k8s-1.28" + - "status-success=ci/centos/mini-e2e/k8s-1.29" - "status-success=ci/centos/upgrade-tests-cephfs" - "status-success=ci/centos/upgrade-tests-rbd" - and: @@ -169,12 +172,15 @@ pull_request_rules: - "status-success=ci/centos/k8s-e2e-external-storage/1.26" - "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.28" + - "status-success=ci/centos/k8s-e2e-external-storage/1.29" - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.29" - "status-success=ci/centos/mini-e2e/k8s-1.26" - "status-success=ci/centos/mini-e2e/k8s-1.27" - "status-success=ci/centos/mini-e2e/k8s-1.28" + - "status-success=ci/centos/mini-e2e/k8s-1.29" - "status-success=ci/centos/upgrade-tests-cephfs" - "status-success=ci/centos/upgrade-tests-rbd" - "status-success=DCO" @@ -262,12 +268,15 @@ pull_request_rules: - "status-success=ci/centos/k8s-e2e-external-storage/1.26" - "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.28" + - "status-success=ci/centos/k8s-e2e-external-storage/1.29" - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.29" - "status-success=ci/centos/mini-e2e/k8s-1.26" - "status-success=ci/centos/mini-e2e/k8s-1.27" - "status-success=ci/centos/mini-e2e/k8s-1.28" + - "status-success=ci/centos/mini-e2e/k8s-1.29" - "status-success=ci/centos/upgrade-tests-cephfs" - "status-success=ci/centos/upgrade-tests-rbd" - "status-success=DCO" @@ -320,12 +329,15 @@ pull_request_rules: - "status-success=ci/centos/k8s-e2e-external-storage/1.26" - "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.28" + - "status-success=ci/centos/k8s-e2e-external-storage/1.29" - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.29" - "status-success=ci/centos/mini-e2e/k8s-1.26" - "status-success=ci/centos/mini-e2e/k8s-1.27" - "status-success=ci/centos/mini-e2e/k8s-1.28" + - "status-success=ci/centos/mini-e2e/k8s-1.29" - "status-success=ci/centos/upgrade-tests-cephfs" - "status-success=ci/centos/upgrade-tests-rbd" - "status-success=DCO" From f464f0b85d53db58466bc035d00991fc28a06936 Mon Sep 17 00:00:00 2001 From: Riya Singhal Date: Wed, 3 Jan 2024 23:25:40 +0530 Subject: [PATCH 2/9] ci: update mergify rules for release branches Signed-off-by: Riya Singhal --- .mergify.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 48086e3abf5..b762885c49b 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -37,6 +37,28 @@ queue_rules: - "status-success=ci/centos/k8s-e2e-external-storage/1.26" - "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.28" + - "status-success=ci/centos/k8s-e2e-external-storage/1.29" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.29" + - "status-success=ci/centos/mini-e2e/k8s-1.26" + - "status-success=ci/centos/mini-e2e/k8s-1.27" + - "status-success=ci/centos/mini-e2e/k8s-1.28" + - "status-success=ci/centos/mini-e2e/k8s-1.29" + - "status-success=ci/centos/upgrade-tests-cephfs" + - "status-success=ci/centos/upgrade-tests-rbd" + - and: + - base=release-v3.10 + - "status-success=codespell" + - "status-success=multi-arch-build" + - "status-success=go-test" + - "status-success=golangci-lint" + - "status-success=mod-check" + - "status-success=lint-extras" + - "status-success=ci/centos/k8s-e2e-external-storage/1.26" + - "status-success=ci/centos/k8s-e2e-external-storage/1.27" + - "status-success=ci/centos/k8s-e2e-external-storage/1.28" - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" @@ -217,6 +239,35 @@ pull_request_rules: - "status-success=ci/centos/k8s-e2e-external-storage/1.26" - "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.28" + - "status-success=ci/centos/k8s-e2e-external-storage/1.29" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" + - "status-success=ci/centos/mini-e2e-helm/k8s-1.29" + - "status-success=ci/centos/mini-e2e/k8s-1.26" + - "status-success=ci/centos/mini-e2e/k8s-1.27" + - "status-success=ci/centos/mini-e2e/k8s-1.28" + - "status-success=ci/centos/mini-e2e/k8s-1.29" + - "status-success=ci/centos/upgrade-tests-cephfs" + - "status-success=ci/centos/upgrade-tests-rbd" + - and: + - label!=DNM + - base=release-v3.10 + - "#approved-reviews-by>=2" + - "#changes-requested-reviews-by=0" + - "approved-reviews-by=@ceph/ceph-csi-contributors" + - "approved-reviews-by=@ceph/ceph-csi-maintainers" + - "status-success=DCO" + - "status-success=codespell" + - "status-success=commitlint" + - "status-success=go-test" + - "status-success=golangci-lint" + - "status-success=lint-extras" + - "status-success=mod-check" + - "status-success=multi-arch-build" + - "status-success=ci/centos/k8s-e2e-external-storage/1.26" + - "status-success=ci/centos/k8s-e2e-external-storage/1.27" + - "status-success=ci/centos/k8s-e2e-external-storage/1.28" - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" From fe050557c9411d60b131b3951a91c89225445eb2 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Wed, 14 Feb 2024 17:34:38 +0100 Subject: [PATCH 3/9] ci: no need to test the devel branch with k8s v1.26 Signed-off-by: Niels de Vos --- .github/workflows/pull-request-commentor.yaml | 2 ++ .mergify.yml | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pull-request-commentor.yaml b/.github/workflows/pull-request-commentor.yaml index 115732d755e..7c6c6e7491e 100644 --- a/.github/workflows/pull-request-commentor.yaml +++ b/.github/workflows/pull-request-commentor.yaml @@ -22,6 +22,8 @@ jobs: k8s: ["1.25", "1.26", "1.27", "1.28", "1.29"] exclude: # the next Ceph-CSI version will not be tested with old Kubernetes + - k8s: "1.26" + branch: "devel" - k8s: "1.25" branch: "devel" - k8s: "1.25" diff --git a/.mergify.yml b/.mergify.yml index b762885c49b..97c894e6568 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -94,15 +94,12 @@ queue_rules: - "status-success=golangci-lint" - "status-success=mod-check" - "status-success=lint-extras" - - "status-success=ci/centos/k8s-e2e-external-storage/1.26" - "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.28" - "status-success=ci/centos/k8s-e2e-external-storage/1.29" - - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" - "status-success=ci/centos/mini-e2e-helm/k8s-1.29" - - "status-success=ci/centos/mini-e2e/k8s-1.26" - "status-success=ci/centos/mini-e2e/k8s-1.27" - "status-success=ci/centos/mini-e2e/k8s-1.28" - "status-success=ci/centos/mini-e2e/k8s-1.29" @@ -191,15 +188,12 @@ pull_request_rules: - "status-success=golangci-lint" - "status-success=mod-check" - "status-success=lint-extras" - - "status-success=ci/centos/k8s-e2e-external-storage/1.26" - "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.28" - "status-success=ci/centos/k8s-e2e-external-storage/1.29" - - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" - "status-success=ci/centos/mini-e2e-helm/k8s-1.29" - - "status-success=ci/centos/mini-e2e/k8s-1.26" - "status-success=ci/centos/mini-e2e/k8s-1.27" - "status-success=ci/centos/mini-e2e/k8s-1.28" - "status-success=ci/centos/mini-e2e/k8s-1.29" @@ -316,15 +310,12 @@ pull_request_rules: - "status-success=commitlint" - "status-success=mod-check" - "status-success=lint-extras" - - "status-success=ci/centos/k8s-e2e-external-storage/1.26" - "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.28" - "status-success=ci/centos/k8s-e2e-external-storage/1.29" - - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" - "status-success=ci/centos/mini-e2e-helm/k8s-1.29" - - "status-success=ci/centos/mini-e2e/k8s-1.26" - "status-success=ci/centos/mini-e2e/k8s-1.27" - "status-success=ci/centos/mini-e2e/k8s-1.28" - "status-success=ci/centos/mini-e2e/k8s-1.29" @@ -377,15 +368,12 @@ pull_request_rules: - "status-success=mod-check" - "status-success=lint-extras" - "#changes-requested-reviews-by=0" - - "status-success=ci/centos/k8s-e2e-external-storage/1.26" - "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.28" - "status-success=ci/centos/k8s-e2e-external-storage/1.29" - - "status-success=ci/centos/mini-e2e-helm/k8s-1.26" - "status-success=ci/centos/mini-e2e-helm/k8s-1.27" - "status-success=ci/centos/mini-e2e-helm/k8s-1.28" - "status-success=ci/centos/mini-e2e-helm/k8s-1.29" - - "status-success=ci/centos/mini-e2e/k8s-1.26" - "status-success=ci/centos/mini-e2e/k8s-1.27" - "status-success=ci/centos/mini-e2e/k8s-1.28" - "status-success=ci/centos/mini-e2e/k8s-1.29" From 5f24d1634f0a7ca56ea3eb262be5aed726b14888 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 15 Feb 2024 13:15:29 +0100 Subject: [PATCH 4/9] ci: update snapshotter to latest version updating csi snapshotter deployment to pull image and rbac from latest released version. Signed-off-by: Madhu Rajanna --- build.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.env b/build.env index 75448aaae1b..32e7dafcf4d 100644 --- a/build.env +++ b/build.env @@ -30,7 +30,7 @@ GOLANGCI_VERSION=v1.54.1 # external snapshotter version # Refer: https://github.com/kubernetes-csi/external-snapshotter/releases -SNAPSHOT_VERSION=v6.2.2 +SNAPSHOT_VERSION=v7.0.1 # "go test" configuration # set to stdout or html to enable coverage reporting, disabled by default From 98b2a32767e321c2294b09026389dd26efddee65 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 15 Feb 2024 13:17:45 +0100 Subject: [PATCH 5/9] ci: install latest version of snapshotter Install latest version of snapshotter and also take care of create/delete of new CRD's and required flag for volumegroupsnapshot operation Signed-off-by: Madhu Rajanna --- scripts/install-snapshot.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/install-snapshot.sh b/scripts/install-snapshot.sh index eb72b2ae2d2..fc204ad3e4c 100755 --- a/scripts/install-snapshot.sh +++ b/scripts/install-snapshot.sh @@ -21,6 +21,11 @@ SNAPSHOTCLASS="${SNAPSHOTTER_URL}/client/config/crd/snapshot.storage.k8s.io_volu VOLUME_SNAPSHOT_CONTENT="${SNAPSHOTTER_URL}/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml" VOLUME_SNAPSHOT="${SNAPSHOTTER_URL}/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml" +# volumegroupsnapshot CRD +VOLUME_GROUP_SNAPSHOTCLASS="${SNAPSHOTTER_URL}/client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml" +VOLUME_GROUP_SNAPSHOT_CONTENT="${SNAPSHOTTER_URL}/client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml" +VOLUME_GROUP_SNAPSHOT="${SNAPSHOTTER_URL}/client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml" + function install_snapshot_controller() { local namespace=$1 if [ -z "${namespace}" ]; then @@ -68,6 +73,24 @@ function create_or_delete_resource() { sed -i "s/namespace: kube-system/namespace: ${namespace}/g" "${temp_snap_controller}" sed -i "s/canary/${SNAPSHOT_VERSION}/g" "${temp_snap_controller}" + if [ "${operation}" == "create" ]; then + # Argument to add/update + ARGUMENT="--enable-volume-group-snapshots=true" + # Check if the argument is already present and set to false + if grep -q -E "^\s+-\s+--enable-volume-group-snapshots=false" "${temp_snap_controller}"; then + sed -i -E "s/^\s+-\s+--enable-volume-group-snapshots=false$/ - $ARGUMENT/" "${temp_snap_controller}" + # Check if the argument is already present and set to true + elif grep -q -E "^\s+-\s+--enable-volume-group-snapshots=true" "${temp_snap_controller}"; then + echo "Argument already present and matching." + else + # Add the argument if it's not present + sed -i -E "/^(\s+)args:/a\ \ - $ARGUMENT" "${temp_snap_controller}" + fi + fi + + kubectl "${operation}" -f "${VOLUME_GROUP_SNAPSHOTCLASS}" + kubectl "${operation}" -f "${VOLUME_GROUP_SNAPSHOT_CONTENT}" + kubectl "${operation}" -f "${VOLUME_GROUP_SNAPSHOT}" kubectl "${operation}" -f "${temp_rbac}" kubectl "${operation}" -f "${temp_snap_controller}" -n "${namespace}" kubectl "${operation}" -f "${SNAPSHOTCLASS}" From 11031091ef5742747fdf3058f58a27a529bcb23e Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 15 Feb 2024 13:20:02 +0100 Subject: [PATCH 6/9] ci: remove unused function remove unused function from the install-snapshot script Signed-off-by: Madhu Rajanna --- scripts/install-snapshot.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/install-snapshot.sh b/scripts/install-snapshot.sh index fc204ad3e4c..378061716c0 100755 --- a/scripts/install-snapshot.sh +++ b/scripts/install-snapshot.sh @@ -98,12 +98,6 @@ function create_or_delete_resource() { kubectl "${operation}" -f "${VOLUME_SNAPSHOT}" } -function delete_snapshot_crd() { - kubectl delete -f "${SNAPSHOTCLASS}" --ignore-not-found - kubectl delete -f "${VOLUME_SNAPSHOT_CONTENT}" --ignore-not-found - kubectl delete -f "${VOLUME_SNAPSHOT}" --ignore-not-found -} - case "${1:-}" in install) install_snapshot_controller "$2" From 5c17d845b2351e7757a1cec29dbe613a7bafdb41 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 15 Feb 2024 13:27:37 +0100 Subject: [PATCH 7/9] ci: fix image version replacement canary tag is no more used in the snapshotter yaml and latest version are used, instead of searching for tag check for the image name and do sed to replace the required tag only. Signed-off-by: Madhu Rajanna --- scripts/install-snapshot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-snapshot.sh b/scripts/install-snapshot.sh index 378061716c0..91e8fa78066 100755 --- a/scripts/install-snapshot.sh +++ b/scripts/install-snapshot.sh @@ -71,7 +71,7 @@ function create_or_delete_resource() { curl -o "${temp_snap_controller}" "${SNAPSHOT_CONTROLLER}" sed -i "s/namespace: kube-system/namespace: ${namespace}/g" "${temp_rbac}" sed -i "s/namespace: kube-system/namespace: ${namespace}/g" "${temp_snap_controller}" - sed -i "s/canary/${SNAPSHOT_VERSION}/g" "${temp_snap_controller}" + sed -i -E "s/(image: registry\.k8s\.io\/sig-storage\/snapshot-controller:).*$/\1$SNAPSHOT_VERSION/g" "${temp_snap_controller}" if [ "${operation}" == "create" ]; then # Argument to add/update From 89501a88656b04d1aa362101480d485a2a42caeb Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 15 Feb 2024 13:32:51 +0100 Subject: [PATCH 8/9] ci: use kubectl_retry helper for kubectl use kubectl_retry helper to avoid intermediate failure and retry again Signed-off-by: Madhu Rajanna --- scripts/install-snapshot.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/scripts/install-snapshot.sh b/scripts/install-snapshot.sh index 91e8fa78066..20b57596fb4 100755 --- a/scripts/install-snapshot.sh +++ b/scripts/install-snapshot.sh @@ -7,6 +7,9 @@ SCRIPT_DIR="$(dirname "${0}")" # shellcheck source=build.env source "${SCRIPT_DIR}/../build.env" +# shellcheck disable=SC1091 +[ ! -e "${SCRIPT_DIR}"/utils.sh ] || source "${SCRIPT_DIR}"/utils.sh + SNAPSHOT_VERSION=${SNAPSHOT_VERSION:-"v5.0.1"} TEMP_DIR="$(mktemp -d)" @@ -34,19 +37,19 @@ function install_snapshot_controller() { create_or_delete_resource "create" "${namespace}" - pod_ready=$(kubectl get pods -l app=snapshot-controller -n "${namespace}" -o jsonpath='{.items[0].status.containerStatuses[0].ready}') + pod_ready=$(kubectl_retry get pods -l app=snapshot-controller -n "${namespace}" -o jsonpath='{.items[0].status.containerStatuses[0].ready}') INC=0 until [[ "${pod_ready}" == "true" || $INC -gt 20 ]]; do sleep 10 ((++INC)) - pod_ready=$(kubectl get pods -l app=snapshot-controller -n "${namespace}" -o jsonpath='{.items[0].status.containerStatuses[0].ready}') + pod_ready=$(kubectl_retry get pods -l app=snapshot-controller -n "${namespace}" -o jsonpath='{.items[0].status.containerStatuses[0].ready}') echo "snapshotter pod status: ${pod_ready}" done if [ "${pod_ready}" != "true" ]; then echo "snapshotter controller creation failed" - kubectl get pods -l app=snapshot-controller -n "${namespace}" - kubectl describe po -l app=snapshot-controller -n "${namespace}" + kubectl_retry get pods -l app=snapshot-controller -n "${namespace}" + kubectl_retry describe po -l app=snapshot-controller -n "${namespace}" exit 1 fi @@ -88,14 +91,14 @@ function create_or_delete_resource() { fi fi - kubectl "${operation}" -f "${VOLUME_GROUP_SNAPSHOTCLASS}" - kubectl "${operation}" -f "${VOLUME_GROUP_SNAPSHOT_CONTENT}" - kubectl "${operation}" -f "${VOLUME_GROUP_SNAPSHOT}" - kubectl "${operation}" -f "${temp_rbac}" - kubectl "${operation}" -f "${temp_snap_controller}" -n "${namespace}" - kubectl "${operation}" -f "${SNAPSHOTCLASS}" - kubectl "${operation}" -f "${VOLUME_SNAPSHOT_CONTENT}" - kubectl "${operation}" -f "${VOLUME_SNAPSHOT}" + kubectl_retry "${operation}" -f "${VOLUME_GROUP_SNAPSHOTCLASS}" + kubectl_retry "${operation}" -f "${VOLUME_GROUP_SNAPSHOT_CONTENT}" + kubectl_retry "${operation}" -f "${VOLUME_GROUP_SNAPSHOT}" + kubectl_retry "${operation}" -f "${temp_rbac}" + kubectl_retry "${operation}" -f "${temp_snap_controller}" -n "${namespace}" + kubectl_retry "${operation}" -f "${SNAPSHOTCLASS}" + kubectl_retry "${operation}" -f "${VOLUME_SNAPSHOT_CONTENT}" + kubectl_retry "${operation}" -f "${VOLUME_SNAPSHOT}" } case "${1:-}" in From 0a82f176718a6f66b20b5da6540d80a63eb45d2b Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 15 Feb 2024 13:51:12 +0100 Subject: [PATCH 9/9] ci: use new label for snapshot controller with new release of snapshotter the labels are changed, this commit uses the new labels to list the snapshot controller pod. Signed-off-by: Madhu Rajanna --- scripts/install-snapshot.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install-snapshot.sh b/scripts/install-snapshot.sh index 20b57596fb4..2f0b12b5dcc 100755 --- a/scripts/install-snapshot.sh +++ b/scripts/install-snapshot.sh @@ -37,19 +37,19 @@ function install_snapshot_controller() { create_or_delete_resource "create" "${namespace}" - pod_ready=$(kubectl_retry get pods -l app=snapshot-controller -n "${namespace}" -o jsonpath='{.items[0].status.containerStatuses[0].ready}') + pod_ready=$(kubectl_retry get pods -l app.kubernetes.io/name=snapshot-controller -n "${namespace}" -o jsonpath='{.items[0].status.containerStatuses[0].ready}') INC=0 until [[ "${pod_ready}" == "true" || $INC -gt 20 ]]; do sleep 10 ((++INC)) - pod_ready=$(kubectl_retry get pods -l app=snapshot-controller -n "${namespace}" -o jsonpath='{.items[0].status.containerStatuses[0].ready}') + pod_ready=$(kubectl_retry get pods -l app.kubernetes.io/name=snapshot-controller -n "${namespace}" -o jsonpath='{.items[0].status.containerStatuses[0].ready}') echo "snapshotter pod status: ${pod_ready}" done if [ "${pod_ready}" != "true" ]; then echo "snapshotter controller creation failed" - kubectl_retry get pods -l app=snapshot-controller -n "${namespace}" - kubectl_retry describe po -l app=snapshot-controller -n "${namespace}" + kubectl_retry get pods -l app.kubernetes.io/name=snapshot-controller -n "${namespace}" + kubectl_retry describe po -l app.kubernetes.io/name=snapshot-controller -n "${namespace}" exit 1 fi