remove confusing flexibility for metadata interpretation

This commit is contained in:
David Eads
2018-04-23 10:23:01 -04:00
parent 9b7439d77d
commit 0710f72c65
34 changed files with 113 additions and 165 deletions

View File

@@ -502,7 +502,7 @@ func UpdateObject(info *resource.Info, codec runtime.Codec, updateFn func(runtim
}
// Update the annotation used by kubectl apply
if err := kubectl.UpdateApplyAnnotation(info, codec); err != nil {
if err := kubectl.UpdateApplyAnnotation(info.Object, codec); err != nil {
return nil, err
}
@@ -517,15 +517,6 @@ func GetDryRunFlag(cmd *cobra.Command) bool {
return GetFlagBool(cmd, "dry-run")
}
// ContainsChangeCause checks if input resource info contains change-cause annotation.
func ContainsChangeCause(info *resource.Info) bool {
annotations, err := info.Mapping.MetadataAccessor.Annotations(info.Object)
if err != nil {
return false
}
return len(annotations[kubectl.ChangeCauseAnnotation]) > 0
}
// GetResourcesAndPairs retrieves resources and "KEY=VALUE or KEY-" pair args from given args
func GetResourcesAndPairs(args []string, pairType string) (resources []string, pairArgs []string, err error) {
foundPair := false