Skip to content

secretGenerator overwrites existing stringData on merge #5955

@weber-software

Description

@weber-software

What happened?

The secretGenerator is overwriting/deleting an existing stringData entry when behavior is set to merge.

What did you expect to happen?

I would expect that the existing stringData is either kept or converted to additional data entries.

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

resources:
  - secret.yaml
secretGenerator:
  - name: test
    literals:
      - property2=value2
    behavior: merge
    options:
      disableNameSuffixHash: false
kind: Secret
apiVersion: v1
metadata:
  name: test
type: Opaque
stringData:
  property1: value1

Expected output

apiVersion: v1
data:
  property1: dmFsdWUx
  property2: dmFsdWUy
kind: Secret
metadata:
  name: test
type: Opaque

Actual output

apiVersion: v1
data:
  property2: dmFsdWUy
kind: Secret
metadata:
  name: test
type: Opaque

Kustomize version

v5.7.1

Operating system

Linux

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions