Unable to upgrade HelmRelease version
carmine-ianniello-deltatre opened this issue · 7 comments
Describe the bug
I have configured an oci repository to deploy my private helm chart on a kubernetes cluster:
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: helm-repo
namespace: flux-system
spec:
type: oci
interval: 5m
url: oci://xxx.amazon.com/helm
provider: aws
Then I have my HelmRelease setup like this;
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: my-apps
namespace: apps
spec:
chart:
spec:
chart: "my-apps"
sourceRef:
kind: HelmRepository
name: helm-repo
namespace: flux-system
version: ">=0.x.x-alpha"
values: {...}
I put the version in this format version: ">=0.x.x-alpha"
since we deploy helm chart with alpha version on our dev environment for each deployment that we do.
Everything was working fine until our version surpassed the 3rd digit.
Basically, we were able to deploy everything until version 0.1.0-alpha99, when we it the 0.1.0-alpha100, 102, etc
The only way to make it works is to put the full version, without any ">=" so, something like 0.1.0-alpha100
I tried something like version ">=0.1.0-alpha100"
but it fell back to the 99 version.
I also tried to use a wildcard ( version: "*"), but it doesn't work, I'm getting
HelmChart 'flux-system/my-apps' is not ready: chart pull error: failed to get chart version for remote reference: could not locate a version matching provided version string *
Am I missing something?
Steps to reproduce
- Adding on oci repository
- try to create a helm release specifying a version above 2 digits and a greater than and equal to
- version: ">=0.x.x-alpha"
- In the moment you have a release with 3digits, helmcontroler will not updated it.
Expected behavior
I'm expecting that the version field can match everything after the version put in place:
version: x.x.x-alpha
Screenshots and recordings
No response
OS / Distro
Kubernetes
Flux version
2.3.0
Flux check
N/A
Git provider
No response
Container Registry provider
No response
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Updating:
The only way to make it work (in some way but not ideal) is to put a range:
version: ">=0.1.0-alpha100 <0.1.0-alpha200"
alpha100 is not something that semver can order by, the correct format is alpha.NUMBER
you really need the dot separat.
I also tried with some helm chart with dot annotation, but it seems not working.
I have something like alpha.108 and another version after alpha.112.
I tried with version: >=x.x.x-alpha.108 "
and didn't upgrade to the .112. I also tried with version: >=x.x.x-alpha.112"
but it just keeps deploying the latest with 2 digits, in my case the alpha98.
As I said alpha98 can’t be used, delete all these tags use the dot form.
I'll try to delete all tags that don't have a dot annotation.
But still, to me, this does not explain why right now, even if I have in my private ECR some alpha version with dot annotation (i.e: alpha.112) if I try to put version: >=x.x.x-alpha.108"
it automatically falls back to a non-dot version, that as you said, it can't be used.
You can use this snippet for testing https://go.dev/play/p/G5yeZs92iE3 Only when all tags are in the alpha.N format, numeric ordering is used.
It worked.
I delete everthing that wasn't with dot notation, I delivered different tag with alpha.N and used version reference like version: >=x.x.x-alpha.108
and it delivered ulti my latest that in my case is alpha.114.
Thanks a lot for your support!