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

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

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

jbtrystram
Copy link
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
Copy link

openshift-ci bot commented Jul 4, 2023

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.

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.

}
PrepareResult::Ready(p) => {
println!(
"New manifest available for {}. Digest {}",
Copy link
Collaborator

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.

return Ok(());
}
} else {
Copy link
Collaborator

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
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
Collaborator

/ok-to-test

@cgwalters
Copy link
Collaborator

Two minor nits on the commit message

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

@cgwalters
Copy link
Collaborator

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 containers#3

Signed-off-by: jbtrystram <jbtrystram@redhat.com>
@jbtrystram
Copy link
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
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
Collaborator

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 containers:main Jul 6, 2023
8 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.

Add upgrade --dry-run or so
2 participants