Skip to content

Add support for buildMetadata in the kustomize generator#1162

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

Add support for buildMetadata in the kustomize generator#1162
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 support for the buildMetadata field in the Flux Kustomization spec. When set, the generator reads the field and passes it through to the generated kustomization.yaml, allowing users to enable originAnnotations and transformerAnnotations per Kustomization without modifying the source repository.

Changes

  • Read buildMetadata from the Flux Kustomization spec in kustomize_generator.go
  • Pass the values through to the generated kustomization.yaml BuildMetadata field
  • Add unit tests covering: buildMetadata with values, empty spec, and no resources scenarios
  • Add test fixtures (testdata/buildMetadata/)

Context

This is the fluxcd/pkg side of the implementation for fluxcd/kustomize-controller#1579. A companion PR on fluxcd/kustomize-controller adds the CRD field, API types, documentation, and integration tests — it will be linked here once created.

Test plan

  • Unit tests pass for TestGenerator_BuildMetadata, TestGenerator_BuildMetadata_EmptySpec, TestGenerator_BuildMetadata_NoResources
  • Integration with kustomize-controller PR

@pmialon pmialon requested a review from stefanprodan as a code owner April 8, 2026 14:13
@stefanprodan stefanprodan added enhancement New feature or request area/kustomize Kustomize related issues and pull requests labels Apr 8, 2026
@pmialon pmialon force-pushed the add-build-metadata branch from 7fbdd4c to a4cb3d1 Compare April 8, 2026 15:53
@stefanprodan
Copy link
Copy Markdown
Member

@pmialon can you please signoff the commit, instructions here: https://github.com/fluxcd/pkg/pull/1162/checks?check_run_id=70456127491

Read the buildMetadata field from the Flux Kustomization spec
and pass it through to the generated kustomization.yaml. This
allows users to enable originAnnotations and transformerAnnotations
per Kustomization without modifying the source repository.

Ref: fluxcd/kustomize-controller#1579
Signed-off-by: Pierre-Gilles Mialon <pmialon@gmail.com>
@pmialon pmialon force-pushed the add-build-metadata branch from a4cb3d1 to 515925b Compare April 9, 2026 06:05
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 c881cea into fluxcd:main Apr 9, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/kustomize Kustomize related issues and pull requests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants