mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 11:12:03 +00:00
Merge pull request #43192 from liggitt/kubectl-test-retry
Automatic merge from submit-queue Retry kubectl test replace on conflict Since kubectl is doing a resource-version-constrained replace, it is subject to conflicts on a contentious resource (like a node managed by the node controller) Fixes #41892 (the specific flake, not the watch cache issue)
This commit is contained in:
@@ -666,16 +666,15 @@ run_pod_tests() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
__EOF__
|
__EOF__
|
||||||
kubectl replace -f - "${kube_flags[@]}" << __EOF__
|
kubectl-with-retry replace "${kube_flags[@]}" -f <(echo '{
|
||||||
{
|
|
||||||
"kind": "Node",
|
"kind": "Node",
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "node-v1-test",
|
"name": "node-v1-test",
|
||||||
"annotations": {"a":"b"}
|
"annotations": {"a":"b"}
|
||||||
}
|
}
|
||||||
}
|
}')
|
||||||
__EOF__
|
|
||||||
# Post-condition: the node command succeeds
|
# Post-condition: the node command succeeds
|
||||||
kube::test::get_object_assert "node node-v1-test" "{{.metadata.annotations.a}}" 'b'
|
kube::test::get_object_assert "node node-v1-test" "{{.metadata.annotations.a}}" 'b'
|
||||||
kubectl delete node node-v1-test "${kube_flags[@]}"
|
kubectl delete node node-v1-test "${kube_flags[@]}"
|
||||||
|
Reference in New Issue
Block a user