Skip to content

Add .spec.buildMetadata optional field to Kustomization API#1632

Merged
stefanprodan merged 1 commit intofluxcd:mainfrom
qube-rt:add-build-metadata
Apr 10, 2026
Merged

Add .spec.buildMetadata optional field to Kustomization API#1632
stefanprodan merged 1 commit intofluxcd:mainfrom
qube-rt:add-build-metadata

Conversation

@pmialon
Copy link
Copy Markdown

@pmialon pmialon commented Apr 8, 2026

Summary

Add a .spec.buildMetadata field to the Kustomization CRD, allowing users to configure kustomize buildMetadata options per Kustomization resource. Supported values are originAnnotations and transformerAnnotations.

Closes #1579

Changes

  • Add BuildMetadata field and BuildMetadataOption type to KustomizationSpec API
  • Update CRD manifest with enum validation (originAnnotations, transformerAnnotations)
  • Update generated deep copy functions
  • Add API reference and spec documentation
  • Add integration test TestKustomizationReconciler_BuildMetadata

Dependencies

This PR depends on fluxcd/pkg#1162 which adds the generator-side support for reading buildMetadata from the Kustomization spec and writing it to the generated kustomization.yaml.

Test plan

@pmialon pmialon force-pushed the add-build-metadata branch 2 times, most recently from 03de887 to 14629fb Compare April 9, 2026 06:05
@stefanprodan stefanprodan added area/kustomize Kustomize related issues and pull requests area/api API related issues and pull requests labels Apr 10, 2026
@stefanprodan
Copy link
Copy Markdown
Member

stefanprodan commented Apr 10, 2026

@pmialon please bump fluxcd/pkg/kustomize to v1.29.0, run make tidy and force push.

Allow users to configure kustomize buildMetadata per Kustomization
resource. Supported values are 'originAnnotations' and
'transformerAnnotations' which add source origin and transformer
tracking annotations to the built resources respectively.

Signed-off-by: Pierre-Gilles Mialon <pmialon@users.noreply.github.com>
Ref: fluxcd#1579
Signed-off-by: Pierre-Gilles Mialon <pmialon@gmail.com>
Signed-off-by: Pierre-Gilles Mialon <pierre-gilles.mialon@qube-rt.com>
@pmialon pmialon force-pushed the add-build-metadata branch from 14629fb to 2ab5e24 Compare April 10, 2026 10:50
@stefanprodan stefanprodan changed the title Add buildMetadata option to Kustomization spec Add .spec.buildMetadata optional field to Kustomization API Apr 10, 2026
Copy link
Copy Markdown
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @pmialon 🥇

@stefanprodan stefanprodan merged commit 2e8dade into fluxcd:main Apr 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API related issues and pull requests area/kustomize Kustomize related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support buildMetadata configuration for Kustomize builds

2 participants