Do not allow downgrades without force flag #699
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit sorts the current OS version with the one we aim to upgrade to. If the OS to be upgraded to is not higher than the current one it assumes we are up to date and the upgrade script exits 0. This causes the upgrade plan to succeed and to be considered as upgraded. This is to fix rancher/elemental-operator#364 (comment)
Alternatively if a downgrade is required it is still possible, but requires a customized
Update Group
(ManagedOSImage
crd) to include theFORCE
environment variable within the upgrade script:With the
FORCE
flag no version is taken into account and the image is applied in any case.elemental-operator
logic makes use of theosImage
field if noupgradeContainer
field is provided to actually create a defaultugpradeContainer
. However ifupgradeContainer
is provided thenosImage
field is ignored. I'd say this logic is not very intuitive, but I'd say this should be handled separately if we consider there is something to change in there.Fixes rancher/elemental-operator#364