Replies: 4 comments 17 replies
-
Does the image tag have its own create time attribute, or does the proposal work without that? Would an image tag have to be capable of being sorted by another attribute, like string sort or semver order, for this proposal to work? I have noticed that Flux v2 docs in places favor the use of build number over the "8-char short commit sha" which I have grown fond of, but unfortunately short hash does not have any property of string sortability; if this shift has been done so that a proposal like this one can take advantage of innate string (or eg. calver/semver) sort order then it helps show the use of this proposal, definitely make sense to me. |
Beta Was this translation helpful? Give feedback.
-
Should we keep that functionality as an option (since we have the code already), but just change the flag to false by default? Removing it altogether sounds like a breaking change? |
Beta Was this translation helpful? Give feedback.
-
In Flux1 we told users to tag their images with I have added an example to the image-reflector-controller API docs on how to write image policies that filter tags based on branch name and select the latest build fluxcd/image-reflector-controller#97. |
Beta Was this translation helpful? Give feedback.
-
The Is there a technical reason why support for the |
Beta Was this translation helpful? Give feedback.
-
Flux v1 goes to some trouble to download metadata and extract the build time for each image, then (by default) uses that to order the images and select the most recent. This is an unreliable* and expensive feature: it requires complicated caching infrastructure to keep accurate image metadata locally, since requesting it every time it's needed is not viable. Getting each image manifest and config file needs a fetch per image, rather than a fetch per repo. Aggressive rate limiting by DockerHub means that it's now difficult to keep an acceptably current cache for image repos hosted there (without a paid account).
(*Why unreliable? It doesn't always pick the image you expect, since a "new" image can refer to existing image layers. Using labels helps with this, since it forces new images to have a distinct config layer.)
An alternative is to put the build time in the image tag, and sort alphabetically. If you can choose the labels used for an image, you can likely choose the tags; and if not, you can at least re-tag images into another repo where you do have that control.
Given a reasonable alternative, and having developed the caching for Flux v1, I am of the opinion that it's better to avoid the complexity and rate limiting of fetching manifests, and only deal with sorting and selecting tags.
Beta Was this translation helpful? Give feedback.
All reactions