Skip to content

Commit

Permalink
Add cnrm annotation to merge3 (#2605)
Browse files Browse the repository at this point in the history
  • Loading branch information
phanimarupaka authored Dec 3, 2021
1 parent 575efe5 commit 2be5cb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/util/merge/merge3.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"path/filepath"
"strings"

"github.com/GoogleContainerTools/kpt/internal/util/attribution"
kptfilev1 "github.com/GoogleContainerTools/kpt/pkg/api/kptfile/v1"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/kio/filters"
Expand Down Expand Up @@ -357,7 +358,7 @@ func (*resourceHandler) equals(r1, r2 *yaml.RNode) (bool, error) {

func stripKyamlAnnos(n *yaml.RNode) error {
for _, a := range []string{mergeSourceAnnotation, kioutil.PathAnnotation, kioutil.IndexAnnotation,
kioutil.LegacyPathAnnotation, kioutil.LegacyIndexAnnotation} {
kioutil.LegacyPathAnnotation, kioutil.LegacyIndexAnnotation, attribution.CNRMMetricsAnnotation} {
err := n.PipeE(yaml.ClearAnnotation(a))
if err != nil {
return err
Expand Down
3 changes: 2 additions & 1 deletion internal/util/update/resource-merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/GoogleContainerTools/kpt/internal/errors"
"github.com/GoogleContainerTools/kpt/internal/pkg"
"github.com/GoogleContainerTools/kpt/internal/types"
pkgdiff "github.com/GoogleContainerTools/kpt/internal/util/diff"
"github.com/GoogleContainerTools/kpt/internal/util/merge"
"github.com/GoogleContainerTools/kpt/internal/util/pkgutil"
kptfilev1 "github.com/GoogleContainerTools/kpt/pkg/api/kptfile/v1"
Expand Down Expand Up @@ -125,7 +126,7 @@ func (u ResourceMergeUpdater) updatePackage(subPkgPath, localPath, updatedPath,
// Package deleted from upstream
case originalExists && localExists && !updatedExists:
// Check the diff. If there are local changes, we keep the subpackage.
diff, err := copyutil.Diff(originalPath, localPath)
diff, err := pkgdiff.PkgDiff(originalPath, localPath)
if err != nil {
return errors.E(op, types.UniquePath(localPath), err)
}
Expand Down

0 comments on commit 2be5cb3

Please sign in to comment.