feat: Support floating tag in product image selection - #1226
Conversation
|
A few points on the CRD change:
Comments on the implementations:
I updated the tests and the refactored the implementation to turn them green again (one is left as an exercise for the reader). I also added some explanatory comments. |
38ffa50 to
83531c7
Compare
Agreed. Like discussed, I now went with
Yes, I think I sufficiently touched on this in my updated doc comment.
I would say that this is implicitly covered by my current doc comment. It basically says, that a container/pod needs to restart in order to have an effect. All your comments on the implementation should be addressed in 83531c7. |
There was a problem hiding this comment.
I have to admin I prefer patchLevelFloatingTag as it makes it a bot more clear what the floatingTag is about.
Also we might want to have a different floating tag for some other functionality in the future (making things up: Only baseOS updates or product version bugfix bumps), in which case the abbreviated field name causes problems (which we don't have when we express what floating tag the user configures).
| product_version, | ||
| stackable_version, | ||
| product_version, | ||
| use_floating_tag, |
There was a problem hiding this comment.
Any reason for the re-ordering (also in other places)?
There was a problem hiding this comment.
No not really, other than my OCD 🙈
I can revert if needed.
There was a problem hiding this comment.
IIRC there even is a clippy lint that when constructing a struct you should use the order of the fields as it's defined in the struct.
That has product_version, stackable_version, use_floating_tag and repo, which I like :)
Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@soenkeliebau mentioned that we might want to remove the term "floating tag" from the field name so that we don't explicitly mention the underlying mechanism (which could change down he line). I agree that it makes sense, but naming things is hard. A few alternative names might be:
|
|
Late to the party, sorry. @Techassi already represented my concerns above. I have since considered this a bit more and can also see a problem with patchLevel since this could be confusing whether it refers to the product version or the stackable version as it sits at the same level in the CRD I believe. CRD could look like this: Which looks like it makes a lot of sense, but the parameters refer to entirely different things, even though they sound totally similar. Also, K8s tends towards enums rather than bools, its even specified in their docs :)
If I may propose a totally new approach (sorry!), how about
and the default being That would give us this: Maybe even |
|
Oh I like the idea with the enum. Two things:
|
|
Indeed, sorry. I am simply unable to keep it straight in my head which case is to be used where :) Edit to mention a random idea that just came to me: |
|
Okay, today we decided to go ahead with @soenkeliebau's enum proposal. The exact structure will look like this: image:
stackableVersionPolicy: Exact # or LatestPatchThe PR description will be updated accordingly as well. |
Part of https://github.com/stackabletech/internal-issues/issues/169.
This PR adds support for auto updating product images. This is done by using a floating tag for product images instead of fully-qualified ones.
Significant changes are:
Add a new
stackableVersionStrategyfield to the product image selection CRD interface:Remove the default of
pullPolicy. This better aligns with the floating tag feature, because if enabled, the pull policy is automatically set toAlways. The current default is (as far as I can see) a leftover from the past. Even the doc comment states thatAlwaysis the default, as we support floating tags (not true).The
stackableVersionfield is now a proper semantic version, instead of a plain string. This is needed, to correctly extract the floating tag if the auto update is enabled.This PR also serves as a decision. Please vote with 👍 or 👎 or leave comments.