Rename id annotations to build annotations.

This commit is contained in:
monopole
2021-01-15 06:39:07 -08:00
parent 79d0d6b5e1
commit 2cb972de3b
13 changed files with 47 additions and 40 deletions

View File

@@ -246,6 +246,6 @@ type ResMap interface {
ApplySmPatch(
selectedSet *resource.IdSet, patch *resource.Resource) error
// Remove annotations used exclusively by the kustomize build process.
RemoveIdAnnotations()
// RemoveBuildAnnotations removes annotations created by the build process.
RemoveBuildAnnotations()
}

View File

@@ -621,8 +621,8 @@ func (m *resWrangler) ApplySmPatch(
return nil
}
func (m *resWrangler) RemoveIdAnnotations() {
func (m *resWrangler) RemoveBuildAnnotations() {
for _, r := range m.Resources() {
r.RemoveIdAnnotations()
r.RemoveBuildAnnotations()
}
}

View File

@@ -998,7 +998,7 @@ spec:
return
}
assert.False(t, tc.errorExpected)
m.RemoveIdAnnotations()
m.RemoveBuildAnnotations()
yml, err := m.AsYaml()
assert.NoError(t, err)
assert.Equal(t, strings.Join(tc.expected, "---\n"), string(yml))
@@ -1111,7 +1111,7 @@ $patch: delete
assert.NoError(t, err, name)
assert.NoError(t, m.ApplySmPatch(idSet, p), name)
assert.Equal(t, tc.finalMapSize, m.Size(), name)
m.RemoveIdAnnotations()
m.RemoveBuildAnnotations()
yml, err := m.AsYaml()
assert.NoError(t, err, name)
assert.Equal(t, tc.expected, string(yml), name)