mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 16:42:51 +00:00
Consider currentId when replacing/merging resources
When merging resources such as the output of a `configMapGenerator`, we need to consider the `CurrentId`, otherwise, we cannot extend a common base definition twice by adding different prefixes, and then further kustomize them. See #1442.
This commit is contained in:
@@ -603,8 +603,10 @@ func (m *resWrangler) AbsorbAll(other ResMap) error {
|
||||
func (m *resWrangler) appendReplaceOrMerge(
|
||||
res *resource.Resource) error {
|
||||
id := res.CurId()
|
||||
// Maybe also try by current id if nothing matches?
|
||||
matches := m.GetMatchingResourcesByOriginalId(id.Equals)
|
||||
if len(matches) == 0 {
|
||||
matches = m.GetMatchingResourcesByCurrentId(id.Equals)
|
||||
}
|
||||
switch len(matches) {
|
||||
case 0:
|
||||
switch res.Behavior() {
|
||||
|
||||
Reference in New Issue
Block a user