File tree Expand file tree Collapse file tree
tests/templates/kuttl/restarter-no-unneeded-restart Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- apiVersion : kuttl.dev/v1beta1
3- kind : TestAssert
4- timeout : 180
5- commands :
6- - script : |
7- kubectl -n $NAMESPACE rollout status sts/early --timeout=5m
8-
9- read n1 t1 n2 t2 n3 t3 < <(
10- kubectl -n $NAMESPACE get pod early-{1,2,0} \
11- -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.metadata.creationTimestamp}{" "}{end}'
12- )
13-
14- if [[ "$t1" > "$t2" || "$t2" > "$t3" ]]; then
15- echo "ERROR: Pod creation order invalid:"
16- printf " %s: %s\n %s: %s\n %s: %s\n" "$n1" "$t1" "$n2" "$t2" "$n3" "$t3"
17- exit 1
18- fi
19-
20- echo "OK: Pod creation order verified:"
21- printf " %s (%s)\n %s (%s)\n %s (%s)\n" "$n1" "$t1" "$n2" "$t2" "$n3" "$t3"
22- echo " Asserted: $n1 <= $n2 <= $n3"
2+ apiVersion : apps/v1
3+ kind : StatefulSet
4+ metadata :
5+ name : early
6+ status :
7+ readyReplicas : 3
8+ replicas : 3
Original file line number Diff line number Diff line change 11---
2- apiVersion : kuttl.dev/v1beta1
3- kind : TestAssert
4- timeout : 180
5- commands :
6- - script : |
7- kubectl -n $NAMESPACE rollout status sts/late --timeout=5m
8-
9- read n0 t0 n1 t1 n2 t2 < <(
10- kubectl -n $NAMESPACE get pod late-{0,1,2} \
11- -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.metadata.creationTimestamp}{" "}{end}'
12- )
13-
14- if [[ "$t0" > "$t1" || "$t1" > "$t2" ]]; then
15- echo "ERROR: Pod creation order invalid:"
16- printf " %s: %s\n %s: %s\n %s: %s\n" "$n0" "$t0" "$n1" "$t1" "$n2" "$t2"
17- exit 1
18- fi
19-
20- echo "OK: Pod creation order verified:"
21- printf " %s (%s)\n %s (%s)\n %s (%s)\n" "$n0" "$t0" "$n1" "$t1" "$n2" "$t2"
22- echo " Asserted: $n0 <= $n1 <= $n2"
2+ apiVersion : apps/v1
3+ kind : StatefulSet
4+ metadata :
5+ name : late
6+ generation : 1
7+ status :
8+ readyReplicas : 3
9+ replicas : 3
You can’t perform that action at this time.
0 commit comments