kustomize-controller v1.8.4: kustomize build produces stale output — new resources in resources: list not applied, removed resources persist
Environment
- flux: v2.8.0
- kustomize-controller: v1.8.4
- source-controller: v1.8.3
Description
When new entries are appended to a resources: list in kustomization.yaml,
the kustomize-controller continues to produce the old build output:
new resources are never applied, and resources previously removed from
kustomization.yaml continue to appear as "unchanged" in server-side apply.
Structure
clusters/dev/apps.yaml → apps Kustomization: path ./apps/environments/dev/clusters/us
apps/environments/dev/clusters/us/kustomization.yaml resources:
- ../../base
- app1.yaml
- app2.yaml ← recently added, never applied
apps/environments/dev/base/kustomization.yaml resources:
- app3.yaml ← old entry, applied correctly
- app4.yaml ← recently added, never applied
- app5.yaml ← recently added, never applied
Steps to Reproduce
- Have a Kustomization with
path: ./apps/environments/dev/clusters/uswherekustomization.yamlreferences../../base - Add a new entry to
../../base/kustomization.yamlresources list - Commit and push
- Run
flux reconcile kustomization <name> --with-source
Expected Behavior
New resource appears in flux get kustomizations and is applied.
Actual Behavior
New resource is never created. The server-side apply completed log
shows the same stale set of resources on every reconciliation.
Investigation
Verified that:
- The source-controller artifact tarball contains the correct, updated
kustomization.yaml(extracted and checked withtar -xOf) - Files for new resources (
app5.yaml) exist in the tarball flux diff kustomization <name>shows no diff (treats stale build as current state)kubectl rollout restart deployment/kustomize-controllerhas no effectflux suspend source git flux-system && flux resumehas no effectflux reconcile kustomization apps --with-sourcehas no effect- A previously deleted resource (
app6, removed fromkustomization.yamlweeks ago) still appears as"unchanged"in every server-side apply output — despite not being present in the tarball
Workaround
Manually creating the Kustomization CR with kubectl apply works correctly.
The issue is specifically with the kustomize-controller's build phase not
reflecting the current state of the artifact.
Source: fluxcd/flux2