mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 09:49:13 +00:00
Manage name changes (prefix/suffix) via YAML annotations rather than via in-memory-only fields.
This commit is contained in:
@@ -589,6 +589,7 @@ func (m *resWrangler) ApplySmPatch(
|
||||
patchCopy.SetName(res.GetName())
|
||||
patchCopy.SetNamespace(res.GetNamespace())
|
||||
patchCopy.SetGvk(res.GetGvk())
|
||||
patchCopy.SetOriginalName(res.GetOriginalName(), true)
|
||||
err := res.ApplySmPatch(patchCopy)
|
||||
if err != nil {
|
||||
// Check for an error string from UnmarshalJSON that's indicative
|
||||
@@ -619,3 +620,13 @@ func (m *resWrangler) ApplySmPatch(
|
||||
m.AppendAll(newRm)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *resWrangler) RemoveIdAnnotations() error {
|
||||
for _, r := range m.Resources() {
|
||||
err := r.RemoveIdAnnotations()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user