alexellis / arkade

Open Source Marketplace For Developer Tools

Home Page:https://blog.alexellis.io/kubernetes-marketplace-two-year-update/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. Running an update where the latest two tags are: prom/prometheus:v2.44.0 and prom/prometheus:v2.45.0-rc0 should not move from a stable version to an RC
  2. The latest two tags are: moby/buildkit:v0.11.6-rootless and moby/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

  1. Detect and extract a semver version
  2. Detect any suffix
  3. 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)

  1. 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?

I'm offering up a small token / bounty 💎 for this - https://twitter.com/alexellisuk/status/1672245426831908864?s=20