File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 14
14
endpts=$1
15
15
echo " checking service imports..."
16
16
17
- imports=$( $KUBECTL_BIN get endpointslices -o json --namespace $NAMESPACE | \
18
- jq ' .items[] | select(.metadata.ownerReferences[].name | startswith("imported")) | .endpoints[].addresses[0]' )
19
- import_count=$( echo " $imports " | wc -l | xargs)
17
+ import_count=0
18
+ poll_count=0
19
+ while (( import_count < EXPECTED_ENDPOINT_COUNT))
20
+ do
21
+ if (( poll_count++ > 30 )) ; then
22
+ echo " timed out polling for import endpoints"
23
+ exit 1
24
+ fi
20
25
21
- if (( import_count != EXPECTED_ENDPOINT_COUNT)) ; then
22
- echo " expected $EXPECTED_ENDPOINT_COUNT imports but found $import_count "
23
- exit 1
24
- fi
26
+ imports=$( $KUBECTL_BIN get endpointslices -o json --namespace $NAMESPACE | \
27
+ jq ' .items[] | select(.metadata.ownerReferences[].name | startswith("imported")) | .endpoints[].addresses[0]' )
28
+ echo " import endpoint list from kubectl:"
29
+ echo " $imports "
30
+
31
+ import_count=$( echo " $imports " | wc -l | xargs)
32
+ done
25
33
26
34
echo " $imports " | tr -d ' "' | while read -r import; do
27
35
echo " checking import: $import "
You can’t perform that action at this time.
0 commit comments