mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
kubectl: update message for a no-op patch
This commit is contained in:
parent
3b4eb0a4a0
commit
3d33301332
@ -331,5 +331,5 @@ func patchOperation(didPatch bool) string {
|
|||||||
if didPatch {
|
if didPatch {
|
||||||
return "patched"
|
return "patched"
|
||||||
}
|
}
|
||||||
return "not patched"
|
return "patched (no change)"
|
||||||
}
|
}
|
||||||
|
@ -439,9 +439,9 @@ run_pod_tests() {
|
|||||||
output_message=$(! kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"metadata":{"labels":"invalid"}}' 2>&1)
|
output_message=$(! kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"metadata":{"labels":"invalid"}}' 2>&1)
|
||||||
kube::test::if_has_string "${output_message}" 'cannot restore map from string'
|
kube::test::if_has_string "${output_message}" 'cannot restore map from string'
|
||||||
|
|
||||||
## Patch exits with error message "not patched" and exit code 0 when no-op occurs
|
## Patch exits with error message "patched (no change)" and exit code 0 when no-op occurs
|
||||||
output_message=$(kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"metadata":{"labels":{"name":"valid-pod"}}}' 2>&1)
|
output_message=$(kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"metadata":{"labels":{"name":"valid-pod"}}}' 2>&1)
|
||||||
kube::test::if_has_string "${output_message}" 'not patched'
|
kube::test::if_has_string "${output_message}" 'patched (no change)'
|
||||||
|
|
||||||
## Patch pod can change image
|
## Patch pod can change image
|
||||||
# Command
|
# Command
|
||||||
|
Loading…
Reference in New Issue
Block a user