-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade: Add error message when staged deployment is incompatible #600
Conversation
lib/src/cli.rs
Outdated
)); | ||
} | ||
|
||
if host.status.staged.is_some() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to drop this part; I know Rust combinators can be quite obscure but it's basically what the map_or(false)
is doing here...if the option is None, then the result will be false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks for the tip
lib/src/cli.rs
Outdated
&& host | ||
.status | ||
.staged | ||
.as_ref() | ||
.map_or(false, |b| b.incompatible) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But for a bigger cleanup, I think we can merge the logic for checking something like this:
let booted_incompatible = host
.status
.booted
.as_ref()
.map_or(false, |b| b.incompatible);
let staged_incompatible = host
.status
.staged
.as_ref()
.map_or(false, |b| b.incompatible);
if booted_incompatible || staged_incompatible {
return Err...
}
or so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, updated
When running `rpm-ostree install <package>` without a reboot, `bootc upgrade` will fail. Prior to this, the error message was unclear of the cause. fixes RHEL-36003 Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
b540238
to
ae5f6bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
When running
rpm-ostree install <package>
without a reboot,bootc upgrade
will fail. Prior to this, the error message was unclear of the cause.fixes RHEL-36003