We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec560b9 commit cbf8ec4Copy full SHA for cbf8ec4
1 file changed
test/cmd/apply.sh
@@ -444,6 +444,18 @@ run_kubectl_server_side_apply_tests() {
444
}
445
__EOF__
446
447
+ # Ensure the API server has recognized and started serving the associated CR API
448
+ local tries=5
449
+ for i in $(seq 1 $tries); do
450
+ local output
451
+ output=$(kubectl "${kube_flags[@]:?}" api-resources --api-group mygroup.example.com -oname)
452
+ if kube::test::if_has_string "$output" resources.mygroup.example.com; then
453
+ break
454
+ fi
455
+ echo "${i}: Waiting for CR API to be available"
456
+ sleep "$i"
457
+ done
458
+
459
# Dry-run create the CR
460
kubectl "${kube_flags[@]:?}" apply --server-side --dry-run=server -f hack/testdata/CRD/resource.yaml "${kube_flags[@]:?}"
461
# Make sure that the CR doesn't exist
0 commit comments