extract util used by jsonmergepatch and SMPatch

This commit is contained in:
ymqytw
2017-02-03 11:49:37 -08:00
parent ab794c6128
commit a910284e17
13 changed files with 351 additions and 256 deletions

View File

@@ -23,7 +23,7 @@ import (
"github.com/evanphx/json-patch"
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/apimachinery/pkg/util/mergepatch"
"k8s.io/apimachinery/pkg/util/yaml"
)
@@ -161,7 +161,7 @@ func (d *Delta) Apply(latest []byte) ([]byte, error) {
}
glog.V(6).Infof("Testing for conflict between:\n%s\n%s", string(d.edit), string(changes))
hasConflicts, err := strategicpatch.HasConflicts(diff1, diff2)
hasConflicts, err := mergepatch.HasConflicts(diff1, diff2)
if err != nil {
return nil, err
}