operator-registry
operator-registry copied to clipboard
opm: `diff` should be able to select specific version(s)
opm alpha diff -i config.yaml
, where some package/channel in config.yaml
contains a version under .channel.versions[]
, only creates bundle/version-to-channel-head diffs for that version. This is desirable in some cases but there are many cases in which only an exact version is desired in the diff. If the version changes in subsequent diff operations, then new versions are added to the diff and the upgrade graphs between them and those in the old model.
The existing versions
key should identify specific versions going forward, and a new startingVersion
key should identify version-to-channel-head (the current versions
behavior); the same goes for bundles
/startingBundle
.
Note: versions
could also accept version ranges, but I'd rather make that a separate feature.
/kind feature
So if I read this correctly, the current interpretation of a versions
is not "this exact version" but "all versions newer or equal to this". This is probably a surprising. Should we think about adding operands to those to form a list of constraints, e.g.
versions:
- <= 2.0
- >= 1.0
with the additional option of
versions:
- 1.0
The latter would mean "mirror just this exact version".
I thought about whether we should take into account state of existing imagesets for this single-version variant. It would mirror the diff to 1.0 or, if there is no prior image data, just mirror 1.0. What this would enable is updating the config.yaml
over time, bumping the version you want to test without having prior knowledge about what was version mirrored last time that might be running in clusters now that I need to update from. But maybe that's too complicated. What would need to be made clear is that if you want to change 1.0 to something newer, you need to start using >= and <= expressions so you are build the correct graphs.
@dinhxuanvu @joelanford
Would requesting minBundle/minVersion
and maxVersion/maxBundle
fall within this RFE in your opinion? If not, I can submit a new issue. I was thinking in order to choose a specific version the min and max versions could be set to the same values (cc @dmesser). Thoughts?