File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -872,10 +872,17 @@ install_snapshot_controller() {
872
872
cnt=0
873
873
expected_running_pods=$( kubectl apply --dry-run=client -o " jsonpath={.spec.replicas}" -f " $SNAPSHOT_CONTROLLER_YAML " )
874
874
expected_namespace=$( kubectl apply --dry-run=client -o " jsonpath={.metadata.namespace}" -f " $SNAPSHOT_CONTROLLER_YAML " )
875
- while [ " $( kubectl get pods -n " $expected_namespace " -l app=snapshot-controller | grep ' Running' -c) " -lt " $expected_running_pods " ]; do
875
+ expect_key='app\.kubernetes\.io/name'
876
+ expected_label=$( kubectl apply --dry-run=client -o " jsonpath={.spec.template.metadata.labels['$expect_key ']}" -f " $SNAPSHOT_CONTROLLER_YAML " )
877
+ if [ -z " ${expected_label} " ]; then
878
+ expect_key='app'
879
+ expected_label=$( kubectl apply --dry-run=client -o " jsonpath={.spec.template.metadata.labels['$expect_key ']}" -f " $SNAPSHOT_CONTROLLER_YAML " )
880
+ fi
881
+ expect_key=${expect_key// \\ / }
882
+ while [ " $( kubectl get pods -n " $expected_namespace " -l " $expect_key " =" $expected_label " | grep ' Running' -c) " -lt " $expected_running_pods " ]; do
876
883
if [ $cnt -gt 30 ]; then
877
884
echo " snapshot-controller pod status:"
878
- kubectl describe pods -n " $expected_namespace " -l app=snapshot-controller
885
+ kubectl describe pods -n " $expected_namespace " -l " $expect_key " = " $expected_label "
879
886
echo >&2 " ERROR: snapshot controller not ready after over 5 min"
880
887
exit 1
881
888
fi
You can’t perform that action at this time.
0 commit comments