From 8522bf089a980cfe9d18cab8ecc097ed914a0de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=81nis=20Bebr=C4=ABtis?= Date: Thu, 1 Aug 2024 12:29:40 +0300 Subject: [PATCH] rollout status is only available for RollingUpdate strategy type --- cmd/ciReleaseDeploy.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/ciReleaseDeploy.go b/cmd/ciReleaseDeploy.go index 9206c1a..feb5181 100644 --- a/cmd/ciReleaseDeploy.go +++ b/cmd/ciReleaseDeploy.go @@ -384,9 +384,9 @@ var ciReleaseDeployCmd = &cobra.Command{ # Wait for resources to be ready # Get all deployments and statefulsets in the release and check the status of each one. - statefulsets=$(kubectl get statefulset -n "$NAMESPACE" -l "release=${RELEASE_NAME}" -o name) + statefulsets=$(kubectl get statefulset -n "${NAMESPACE}" -l "release=${RELEASE_NAME}" -o=json | jq '.items[]|select(.spec.updateStrategy.type=="RollingUpdate")|.metadata.name') if [ ! -z "$statefulsets" ]; then - echo "$statefulsets" | xargs -n 1 kubectl rollout status -n "$NAMESPACE" --timeout 5m + echo "$statefulsets" | xargs -n 1 kubectl rollout status statefulset -n "$NAMESPACE" --timeout 5m fi kubectl get deployment -n "$NAMESPACE" -l "release=${RELEASE_NAME}" -o name | xargs -n 1 kubectl rollout status -n "$NAMESPACE" --timeout 5m `, @@ -617,9 +617,9 @@ var ciReleaseDeployCmd = &cobra.Command{ # Wait for resources to be ready # Get all deployments and statefulsets in the release and check the status of each one. - statefulsets=$(kubectl get statefulset -n "$NAMESPACE" -l "release=${RELEASE_NAME}" -o name) + statefulsets=$(kubectl get statefulset -n "${NAMESPACE}" -l "release=${RELEASE_NAME}" -o=json | jq '.items[]|select(.spec.updateStrategy.type=="RollingUpdate")|.metadata.name') if [ ! -z "$statefulsets" ]; then - echo "$statefulsets" | xargs -n 1 kubectl rollout status -n "$NAMESPACE" --timeout 5m + echo "$statefulsets" | xargs -n 1 kubectl rollout status statefulset -n "$NAMESPACE" --timeout 5m fi kubectl get deployment -n "$NAMESPACE" -l "release=${RELEASE_NAME}" -o name | xargs -n 1 kubectl rollout status -n "$NAMESPACE" --timeout 5m `,