-
Notifications
You must be signed in to change notification settings - Fork 721
Description
Describe the bug
When multiple instances of the flux build kustomization command are run concurrently, there is a chance of corruption due to the file writing of .original creation and related logic. This manifests as;
kustomization.yamlfiles being modified/corruptedkustomization.yamlfiles being emptiedkustomization.yaml.originalfiles being left behind- failing builds, due to the above
A similar build failure also occurs if the repository files/directories are read-only.
Steps to reproduce
Given that this is a timing-sensitive issue, I've created a set of small reproduction scripts at https://github.com/rycli/fluxcd-kustomize-build-bug-repro . See the README.txt for example output of the failures.
Expected behavior
One or more of the following:
flux kustomize builddoes not write any files.- flux only writes files when necessary (e.g., missing kustomization.yaml file)
- flux writes all of its files to a tempdir/the configured cache dir.
OS / Distro
macOS 26, Ubuntu 24
Flux version
v2.8.1
Additional context
While this doesn't happen on every execution, I'm consistently running into this issue when running Flux in CI/CD pipelines. I'm running a busy multi-tenant environment with very frequent automated checks; these issues end up showing up rather frequently.
Code of Conduct
- I agree to follow this project's Code of Conduct