Revert "try old patch after new patch fails"

This reverts commit f32696e734.
This commit is contained in:
ymqytw
2016-11-22 21:02:30 -08:00
parent 9b16b435fc
commit d248843b65
18 changed files with 123 additions and 58 deletions

View File

@@ -321,6 +321,11 @@ func (o TaintOptions) RunTaint() error {
return err
}
smPatchVersion, err := cmdutil.GetServerSupportedSMPatchVersionFromFactory(o.f)
if err != nil {
return err
}
return r.Visit(func(info *resource.Info, err error) error {
if err != nil {
return err
@@ -343,8 +348,7 @@ func (o TaintOptions) RunTaint() error {
if err != nil {
return err
}
// Defaulting to SMPatchVersion_1_5 is safe, since we don't update list of primitives.
patchBytes, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, obj, strategicpatch.SMPatchVersion_1_5)
patchBytes, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, obj, smPatchVersion)
createdPatch := err == nil
if err != nil {
glog.V(2).Infof("couldn't compute patch: %v", err)