Skip to content
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: fix --apply when the desired deployment is already staged #256

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

jeckersb
Copy link
Contributor

Previously, running:

bootc update; bootc update --apply

would result in the system not rebooting to apply the previously-staged deployment.

Closes: #234

Previously, running:

`bootc update; bootc update --apply`

would result in the system not rebooting to apply the
previously-staged deployment.

Closes: containers#234
Signed-off-by: John Eckersberg <[email protected]>
Copy link

openshift-ci bot commented Jan 11, 2024

Hi @jeckersb. Thanks for your PR.

I'm waiting for a containers member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@cgwalters
Copy link
Collaborator

/ok-to-test

@@ -356,6 +356,10 @@ async fn upgrade(opts: UpgradeOpts) -> Result<()> {
.unwrap_or_default();
if staged_unchanged {
println!("Staged update present, not changed.");

if opts.apply {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm....I need to think about this. Is it that simple? Yeah, I think that will work. I'm OK with this though I do wonder if we should basically set changed=true in this case instead and just fall through.

If we do that, then maybe the changed variable is misnamed and it's really just bool have_staged.

(BTW we should probably drop --touch-if-changed since I think it's better done by querying the status API)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I had the same reaction once I wrapped my head around things (is it this simple??). Agreed with everything else you said though. My only other thought was the bit in the help on --apply re: "In the future this command will detect the case where no kernel changes are queued, and perform a userspace-only restart." which will require some additional rearranging of things. Maybe we just leave it for now and then it'll shake out in that future reorganization.

@cgwalters cgwalters merged commit fad73f2 into containers:main Jan 12, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apply not idempotent
2 participants