kubectl: update message for a no-op patch

This commit is contained in:
Nikhita Raghunath 2018-08-14 18:07:11 +05:30
parent 3b4eb0a4a0
commit 3d33301332
No known key found for this signature in database
GPG Key ID: 565C11F0FFCFA4EC
2 changed files with 3 additions and 3 deletions

View File

@ -331,5 +331,5 @@ func patchOperation(didPatch bool) string {
if didPatch {
return "patched"
}
return "not patched"
return "patched (no change)"
}

View File

@ -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