mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
fix: deflake run_kubectl_apply_tests
Signed-off-by: knight42 <anonymousknight96@gmail.com>
This commit is contained in:
parent
ec560b9737
commit
cbf8ec4e2d
@ -444,6 +444,18 @@ run_kubectl_server_side_apply_tests() {
|
|||||||
}
|
}
|
||||||
__EOF__
|
__EOF__
|
||||||
|
|
||||||
|
# Ensure the API server has recognized and started serving the associated CR API
|
||||||
|
local tries=5
|
||||||
|
for i in $(seq 1 $tries); do
|
||||||
|
local output
|
||||||
|
output=$(kubectl "${kube_flags[@]:?}" api-resources --api-group mygroup.example.com -oname)
|
||||||
|
if kube::test::if_has_string "$output" resources.mygroup.example.com; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "${i}: Waiting for CR API to be available"
|
||||||
|
sleep "$i"
|
||||||
|
done
|
||||||
|
|
||||||
# Dry-run create the CR
|
# Dry-run create the CR
|
||||||
kubectl "${kube_flags[@]:?}" apply --server-side --dry-run=server -f hack/testdata/CRD/resource.yaml "${kube_flags[@]:?}"
|
kubectl "${kube_flags[@]:?}" apply --server-side --dry-run=server -f hack/testdata/CRD/resource.yaml "${kube_flags[@]:?}"
|
||||||
# Make sure that the CR doesn't exist
|
# Make sure that the CR doesn't exist
|
||||||
|
Loading…
Reference in New Issue
Block a user