Revert "support patch list of primitives"

This reverts commit 34891ad9f6.
This commit is contained in:
ymqytw
2016-11-22 21:06:36 -08:00
parent 18f4395f80
commit 3cc294b1e0
27 changed files with 1661 additions and 2659 deletions

View File

@@ -521,7 +521,7 @@ func RecordChangeCause(obj runtime.Object, changeCause string) error {
// ChangeResourcePatch creates a strategic merge patch between the origin input resource info
// and the annotated with change-cause input resource info.
func ChangeResourcePatch(info *resource.Info, changeCause string, smPatchVersion strategicpatch.StrategicMergePatchVersion) ([]byte, error) {
func ChangeResourcePatch(info *resource.Info, changeCause string) ([]byte, error) {
oldData, err := json.Marshal(info.Object)
if err != nil {
return nil, err
@@ -533,7 +533,7 @@ func ChangeResourcePatch(info *resource.Info, changeCause string, smPatchVersion
if err != nil {
return nil, err
}
return strategicpatch.CreateTwoWayMergePatch(oldData, newData, info.Object, smPatchVersion)
return strategicpatch.CreateTwoWayMergePatch(oldData, newData, info.Object)
}
// containsChangeCause checks if input resource info contains change-cause annotation.
@@ -725,13 +725,3 @@ func RequireNoArguments(c *cobra.Command, args []string) {
CheckErr(UsageError(c, fmt.Sprintf(`unknown command %q`, strings.Join(args, " "))))
}
}
// GetServerSupportedSMPatchVersionFromFactory is a wrapper of GetServerSupportedSMPatchVersion(),
// It takes a Factory, returns the max version the server supports.
func GetServerSupportedSMPatchVersionFromFactory(f Factory) (strategicpatch.StrategicMergePatchVersion, error) {
clientSet, err := f.ClientSet()
if err != nil {
return strategicpatch.Unknown, err
}
return strategicpatch.GetServerSupportedSMPatchVersion(clientSet.Discovery())
}