mirror of https://github.com/k3s-io/k3s
Merge pull request #67385 from nikhita/patch-no-op-msg
Automatic merge from submit-queue (batch tested with PRs 67347, 67307, 67358, 67364, 67385). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. kubectl: update message for a no-op patch Fixes https://github.com/kubernetes/kubernetes/issues/67344 /cc liggitt juanvallejo soltysh timoreimann /sig cli **Release note**: ```release-note NONE ```pull/8/head
commit
a8fbaf95f9
|
@ -331,5 +331,5 @@ func patchOperation(didPatch bool) string {
|
|||
if didPatch {
|
||||
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)
|
||||
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)
|
||||
kube::test::if_has_string "${output_message}" 'not patched'
|
||||
kube::test::if_has_string "${output_message}" 'patched (no change)'
|
||||
|
||||
## Patch pod can change image
|
||||
# Command
|
||||
|
|
Loading…
Reference in New Issue