Edge-cases where arkade chart upgrade picks the wrong tag
alexellis opened this issue · comments
There are two edge-cases where arkade chart upgrade picks the wrong tag for an image
Expected Behaviour
- Running an update where the latest two tags are:
prom/prometheus:v2.44.0
andprom/prometheus:v2.45.0-rc0
should not move from a stable version to an RC - The latest two tags are:
moby/buildkit:v0.11.6-rootless
andmoby/buildkit:v0.11.6
. In my YAML file I have:moby/buildkit:v0.11.6-rootless
, but the upgrade command just finds the latest and replaces it with:moby/buildkit:v0.11.6
which is wrong
Possible Solution
- Detect and extract a semver version
- Detect any suffix
- When finding the latest tags, make sure the suffix is matched - for the case where it is "" and when it's anything else like "rootless"
Steps to Reproduce (for bugs)
- Run helm chart upgrade on a values.yaml like this:
builder:
image: moby/buildkit:v0.11.5-rootless
prom:
image: prom/prometheus:v2.44.0
Wrong output:
builder:
image: moby/buildkit:v0.11.6
prom:
image: prom/prometheus:v2.45.0-rc.0
Right output:
builder:
image: moby/buildkit:v0.11.6-rootless
prom:
image: prom/prometheus:v2.44.0
Context
This makes means additional checking and having to undo/manually change the upgrade steps
See also: https://github.com/alexellis/arkade/blob/master/cmd/chart/upgrade.go
Any PR should have tests that show the original problem is fixed, this may require a little refactoring.
Who feels like a challenge and can work on this within the next few days?
@joebowbeer wdyt?
I'm offering up a small token / bounty 💎 for this - https://twitter.com/alexellisuk/status/1672245426831908864?s=20