Skip to content

Commit 2cc60ec

Browse files
committed
e2e: fix dbops-restart-with-failed-pod
1 parent 90e9622 commit 2cc60ec

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

stackgres-k8s/e2e/spec/dbops-restart-with-failed-pod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ check_cluster_start_not_fail_if_cluster_failed() {
3030
set_restarted_pods
3131
kubectl patch sgcluster -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" --type json \
3232
-p '[{"op":"add","path":"/spec/pods/scheduling","value":{"nodeSelector":{"test":"test"}}}]'
33+
wait_until eval 'kubectl get sts -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" -o json \
34+
| jq .spec.nodeSelector.test | grep -q test'
3335

3436
cat << EOF | kubectl create -f -
3537
apiVersion: stackgres.io/v1
@@ -49,6 +51,8 @@ EOF
4951

5052
wait_until kubectl patch sgcluster -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" --type json \
5153
-p '[{"op":"remove","path":"/spec/pods/scheduling"}]'
54+
wait_until eval 'kubectl get sts -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" -o json \
55+
| jq .spec.nodeSelector | grep -q null'
5256

5357
cat << EOF | kubectl create -f -
5458
apiVersion: stackgres.io/v1
@@ -77,6 +81,8 @@ check_cluster_start_not_fail_if_pod_failed() {
7781
set_restarted_pods dbops-restart-with-failed-pod-1 dbops-restart-with-failed-pod-0
7882
kubectl patch sgcluster -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" --type json \
7983
-p '[{"op":"add","path":"/spec/pods/scheduling","value":{"nodeSelector":{"test":"test"}}}]'
84+
wait_until eval 'kubectl get sts -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" -o json \
85+
| jq .spec.nodeSelector.test | grep -q test'
8086

8187
cat << EOF | kubectl create -f -
8288
apiVersion: stackgres.io/v1
@@ -96,6 +102,8 @@ EOF
96102

97103
wait_until kubectl patch sgcluster -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" --type json \
98104
-p '[{"op":"remove","path":"/spec/pods/scheduling"}]'
105+
wait_until eval 'kubectl get sts -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" -o json \
106+
| jq .spec.nodeSelector | grep -q null'
99107

100108
cat << EOF | kubectl create -f -
101109
apiVersion: stackgres.io/v1

0 commit comments

Comments
 (0)