Merge "Chore: Update Sonar OpenJDK version" v0.89.3
authorMatthew Watkins <mwatkins@linuxfoundation.org>
Tue, 31 Oct 2023 17:17:11 +0000 (17:17 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Tue, 31 Oct 2023 17:17:11 +0000 (17:17 +0000)
shell/openstack-cleanup-orphaned-k8s-clusters.sh

index 0e5f392..0491334 100644 (file)
@@ -87,6 +87,11 @@ for CLUSTER_NAME in "${OS_COE_CLUSTERS[@]}"; do
     if cluster_in_jenkins "$CLUSTER_NAME" $jenkins_urls; then
         # No need to delete stacks if there exists an active build for them
         continue
+    elif [[ "$CLUSTER_NAME" == *-managed-prod-k8s-* ]] || \
+         [[ "$CLUSTER_NAME" == *-managed-test-k8s-* ]]; then
+        # Don't destroy long lived managed k8s clusters used in Jenkins jobs
+        echo "Not deleting managed cluster: $CLUSTER_NAME"
+        continue
     else
         echo "Deleting orphaned k8s cluster: $CLUSTER_NAME"
         openstack --os-cloud "$os_cloud" coe cluster delete "$CLUSTER_NAME"