From 3d33301332517cc5fa0ce88eec7693688497a6e7 Mon Sep 17 00:00:00 2001 From: Nikhita Raghunath Date: Tue, 14 Aug 2018 18:07:11 +0530 Subject: [PATCH] kubectl: update message for a no-op patch --- pkg/kubectl/cmd/patch.go | 2 +- test/cmd/core.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/kubectl/cmd/patch.go b/pkg/kubectl/cmd/patch.go index 51e967aa112..500ba478f11 100644 --- a/pkg/kubectl/cmd/patch.go +++ b/pkg/kubectl/cmd/patch.go @@ -331,5 +331,5 @@ func patchOperation(didPatch bool) string { if didPatch { return "patched" } - return "not patched" + return "patched (no change)" } diff --git a/test/cmd/core.sh b/test/cmd/core.sh index 62c8ff84463..0973022b2f0 100755 --- a/test/cmd/core.sh +++ b/test/cmd/core.sh @@ -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