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