Created
September 5, 2018 20:56
-
-
Save juanvallejo/dc0c29923bae3a7997d4d60fe0a5f149 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/pkg/kubectl/cmd/label.go b/pkg/kubectl/cmd/label.go | |
index 4aedac04ef..70efe87fc8 100644 | |
--- a/pkg/kubectl/cmd/label.go | |
+++ b/pkg/kubectl/cmd/label.go | |
@@ -254,11 +254,22 @@ func (o *LabelOptions) RunLabel() error { | |
var outputObj runtime.Object | |
dataChangeMsg := "not labeled" | |
if o.dryrun || o.local || o.list { | |
+ obj := info.Object | |
+ oldObj, err := json.Marshal(obj) | |
+ if err != nil { | |
+ return err | |
+ } | |
err = labelFunc(info.Object, o.overwrite, o.resourceVersion, o.newLabels, o.removeLabels) | |
if err != nil { | |
return err | |
} | |
- dataChangeMsg = "labeled" | |
+ newObj, err := json.Marshal(obj) | |
+ if err != nil { | |
+ return err | |
+ } | |
+ if !reflect.DeepEqual(oldObj, newObj) { | |
+ dataChangeMsg = "labeled" | |
+ } | |
outputObj = info.Object | |
} else { | |
obj := info.Object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment