fluxcd / flux2-kustomize-helm-example

A GitOps workflow example for multi-env deployments with Flux, Kustomize and Helm.
https://fluxcd.io
Apache License 2.0
990 stars 1.05k forks source link

Select which pre-release I want to install #75

Closed silveraignacio closed 2 years ago

silveraignacio commented 2 years ago

Hello! How can I achive to select which pre-release I want to install.

For example I have a chart that has one Release version and many pre-release called 1.x-dev and 1.x-uat. Due that Flux is using semver to select version, always is taking versions that finish with -uat because it use ASCII sort order to get the latest, so all the non productive environments are using the same chart version.

Is there any way of filter per postfix or some other way to select the chart depending of the environment? We are using the same directory structure as it is in the example.

Thanks!

stefanprodan commented 2 years ago

The semver v2 spec has no support for this, you can either set the range to include prereleases or not.

stefanprodan commented 2 years ago

One workaround would be to include the stage name in the chart name, so you'll have something like this <name>-<env>:<version>.: e.g. app-dev, app-uat, app-prod.

silveraignacio commented 2 years ago

One workaround would be to include the stage name in the chart name, so you'll have something like this <name>-<env>:<version>.: e.g. app-dev, app-uat, app-prod.

Can you explain it more please? I think I couldn't catch your idea. Do you reffer when the chart is generated, it should have the environment as postfix?

stefanprodan commented 2 years ago

Do you reffer when the chart is generated, it should have the environment as postfix?

Yes, instead of encoding the env in the version, you would encode it in the chart name, then to promote a chart you would push it again under a different name but with the same version.

silveraignacio commented 2 years ago

Yeah! I got you know! Thanks that can be a great idea.

kingdonb commented 2 years ago

It looks like this is resolved! Thanks for reporting this issue 👍