Skip to content

Commit 2be5cb3

Browse files
Add cnrm annotation to merge3 (#2605)
1 parent 575efe5 commit 2be5cb3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

internal/util/merge/merge3.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"path/filepath"
1919
"strings"
2020

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

358359
func stripKyamlAnnos(n *yaml.RNode) error {
359360
for _, a := range []string{mergeSourceAnnotation, kioutil.PathAnnotation, kioutil.IndexAnnotation,
360-
kioutil.LegacyPathAnnotation, kioutil.LegacyIndexAnnotation} {
361+
kioutil.LegacyPathAnnotation, kioutil.LegacyIndexAnnotation, attribution.CNRMMetricsAnnotation} {
361362
err := n.PipeE(yaml.ClearAnnotation(a))
362363
if err != nil {
363364
return err

internal/util/update/resource-merge.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/GoogleContainerTools/kpt/internal/errors"
2626
"github.com/GoogleContainerTools/kpt/internal/pkg"
2727
"github.com/GoogleContainerTools/kpt/internal/types"
28+
pkgdiff "github.com/GoogleContainerTools/kpt/internal/util/diff"
2829
"github.com/GoogleContainerTools/kpt/internal/util/merge"
2930
"github.com/GoogleContainerTools/kpt/internal/util/pkgutil"
3031
kptfilev1 "github.com/GoogleContainerTools/kpt/pkg/api/kptfile/v1"
@@ -125,7 +126,7 @@ func (u ResourceMergeUpdater) updatePackage(subPkgPath, localPath, updatedPath,
125126
// Package deleted from upstream
126127
case originalExists && localExists && !updatedExists:
127128
// Check the diff. If there are local changes, we keep the subpackage.
128-
diff, err := copyutil.Diff(originalPath, localPath)
129+
diff, err := pkgdiff.PkgDiff(originalPath, localPath)
129130
if err != nil {
130131
return errors.E(op, types.UniquePath(localPath), err)
131132
}

0 commit comments

Comments
 (0)