Skip to content

configMapGenerator: cannot merge or replace from components #5924

@sgurdiel

Description

@sgurdiel

What happened?

Build fails

What did you expect to happen?

Build succeeds and configMap in overlay is merged with component configMap

How can we reproduce it (as minimally and precisely as possible)?

# components/co1/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

configMapGenerator:
- name: configmap-name
  namespace: default
  literals:
  - hello=world
# overlays/o1/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

components:
- ../../components/co1

configMapGenerator:
- name: configmap-name
  namespace: default
  behavior: merge
  literals:
  - hello=planet
kustomize build overlays/o1

Expected output

apiVersion: v1
data:
  hello: planet
kind: ConfigMap
metadata:
  name: configmap-name-m52bmf6b5t
  namespace: default

Actual output

Error: merging from generator &{0xc000390270 <nil>}: id resid.ResId{Gvk:resid.Gvk{Group:"", Version:"v1", Kind:"ConfigMap", isClusterScoped:false}, Name:"configmap-name", Namespace:"default"} does not exist; cannot merge or replace

Kustomize version

5.6.0, 5.5.0

Operating system

Linux

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions