fluxcd / kustomize-controller

The GitOps Toolkit Kustomize reconciler
https://fluxcd.io
Apache License 2.0
254 stars 182 forks source link

post build variable substition with repository sha #1258

Open AnthonyPoschen opened 2 months ago

AnthonyPoschen commented 2 months ago

looking for the ability in the post build to use the current revision sha as image tags.

the way my organisation uses flux is that we need to do timed releases and so we promote static tags to the revision we wish to deploy when we are in the deployment window. Which means we currently will do the following flow.

i would love to be able to bypass needing to do another commit back in to the repository when ideally i can instead just ensure all containers are tagged with the commit sha of the repository so they are selected correctly. image policy looked too complicated where its goal is to discover the correct image usually by simply looking up the latest and do a commit back to the repository automatically. I am just looking for something simpler and easier to reason about without needing an extra commit per application change.

so naturally the first thing that came to mind was to do post build variable substations to inject the revision being parsed by kustomize into fields within my yaml definition. I couldn't find any pre defined variables listed anywhere unfortunately.

i hope i explained the problem space well enough, maybe im missing some documentation on how to use existing features to achieve this.