Skip to content

cli: Add a --check flag for update - #105

Merged
cgwalters merged 1 commit into
bootc-dev:mainfrom
jbtrystram:update-dry-run
Jul 6, 2023
Merged

cgwalters merged 1 commit into
bootc-dev:mainfrom
jbtrystram:update-dry-run

Conversation

@jbtrystram

Copy link
Copy Markdown
Contributor

This simply pull the manifest of the iamge to see if any update and available. It could be named --dry-run but I wanted to be consistent with rpm-ostree.
Fixes #3

@openshift-ci

openshift-ci Bot commented Jul 4, 2023

Copy link
Copy Markdown

Hi @jbtrystram. 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.

Details

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.

Comment thread lib/src/cli.rs
}
PrepareResult::Ready(p) => {
println!(
"New manifest available for {}. Digest {}",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One less than ideal thing here is that it leaves open the problem of how programmatic access would work - if I'm scripting bootc, I'd have to parse this text designed for human readability.

We already have a --touch-if-changed CLI option which is designed for the non-check case, so let's honor it with --check too.

Comment thread lib/src/cli.rs
}
return Ok(());
}
} else {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since we have a return above I don't think we need to indent everything here, right? (Though if you follow my above suggestion, the touch_if_changed handling would be outside the else)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated the PR with a change in the return statement and moved the touch_if_changed handling outside of the else. Now it will carry on and honor the option.
However that keeps the indentation.

@cgwalters

Copy link
Copy Markdown
Member

/ok-to-test

@cgwalters

Copy link
Copy Markdown
Member

Two minor nits on the commit message

  • Typo "iamge"
  • Please drop the trailing "." in the subject line

@cgwalters

Copy link
Copy Markdown
Member

BTW, this will conflict with #106 - I forgot you'd been looking at this issue. How these two intersect is actually very interesting because semantically that's about adding a declarative flow...so to properly model things here we may need to split out a "discovered but not downloaded" state internally.

This simply pull the manifest of the image to see if any update and
available. It could be named `--dry-run` but I wanted to be consistent
with `rpm-ostree`
Fixes #3

Signed-off-by: jbtrystram <[email protected]>
@jbtrystram

Copy link
Copy Markdown
Contributor Author

Two minor nits on the commit message

* Typo "iamge"

* Please drop the trailing "." in the subject line

I amended the commit message fixing that :)

@jbtrystram

Copy link
Copy Markdown
Contributor Author

BTW, this will conflict with #106 - I forgot you'd been looking at this issue. How these two intersect is actually very interesting because semantically that's about adding a declarative flow...so to properly model things here we may need to split out a "discovered but not downloaded" state internally.

which PR do you want to merge first ? I'm fine waiting for your changes then rebasing this

@cgwalters cgwalters changed the title cli: Add a --check flag for update. cli: Add a --check flag for update Jul 6, 2023
@cgwalters

Copy link
Copy Markdown
Member

which PR do you want to merge first ? I'm fine waiting for your changes then rebasing this

Mmmm...my inclination here is to merge your work first because I want to prioritize new contributors. So let's do that. Thanks for the PR!

@cgwalters
cgwalters merged commit 41ebc7f into bootc-dev:main Jul 6, 2023
cgwalters-bot pushed a commit to cgwalters-bot/bootc that referenced this pull request Nov 11, 2026
The regression test for bootc#2402 carried by upstream PR 2634 skips
itself when /boot is not an automount, so a general integration run
can go green without ever exercising the bug. This adds a separate,
disabled-by-default plan that runs the exact pinned test revision on
an ostree-backed Fedora 44 guest with /boot on the root filesystem,
rejects any other layout in prepare, and requires the updated
deployment to have booted in finish. The `just test-boot-automount`
recipe enables the plan by context and uses the new `--require-plan`
option of `cargo xtask run-tmt`, so a disabled or missing plan is an
error rather than an empty successful run.

The test source stays in PR 2634 (issue bootc-dev#105) and is consumed read-only
through tmt discovery; building images for the affected and fixed
ostree revisions and the CI job are not part of this change.

Part of bootc-dev#107

Verified with the xtask tests, `cargo xtask update-generated direct
--check`, `tmt plan lint` and a discover-only run against the pin; no
VM run was possible here.

Generated-by: AI
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.

Add upgrade --dry-run or so

2 participants