-
Notifications
You must be signed in to change notification settings - Fork 309
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
ostree-sysroot: make simple_write_deployment smarter #1110
ostree-sysroot: make simple_write_deployment smarter #1110
Conversation
Also convert ot-admin-builtin-deploy.c. Prep for more work there.
This is a follow-up to ostreedev#1097. We make simple_write_deployment smart enough so that it can be used for rpm-ostree's purposes. This is mostly an upstreaming of logic that already existed there. Notably we correctly append NOT_DEFAULT deployments *after* the booted deployment and we now support RETAIN_PENDING and RETAIN_ROLLBACK flags to have more granularity on deployment pruning. Expose these new flags on the CLI using new options (as well as expose the previously existing NOT_DEFAULT flag as --not-as-default). I couldn't add tests for --retain-pending because the merge deployment is always the topmost one. Though I did check that it worked in a VM.
I only glanced at this quickly so far (though first patch looks obviously correct); but am I correct in thinking that we can't quite use this in rpm-ostree yet since we also have the livefs logic? EDIT: I see the rpm-ostree patch. |
Usage in coreos/rpm-ostree#942 |
src/libostree/ostree-sysroot.c
Outdated
* to put the new deployment right after the current default in the | ||
* order. | ||
*/ | ||
if (!added_new) |
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.
Hm, don't we need this to handle the initial-deployment case?
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.
Good catch. Fixed in ⬇️!
I'd wondered why it didn't break the tests, it turns out this API isn't called for initial deployments right now. Which is OK, but I'd still say worth supporting. |
This is a follow-up to #1097. We make simple_write_deployment smart enough so that it can be used for rpm-ostree's purposes. This is mostly an upstreaming of logic that already existed there. Notably we correctly append NOT_DEFAULT deployments *after* the booted deployment and we now support RETAIN_PENDING and RETAIN_ROLLBACK flags to have more granularity on deployment pruning. Expose these new flags on the CLI using new options (as well as expose the previously existing NOT_DEFAULT flag as --not-as-default). I couldn't add tests for --retain-pending because the merge deployment is always the topmost one. Though I did check that it worked in a VM. Closes: #1110 Approved by: cgwalters
☀️ Test successful - status-atomicjenkins |
This is a follow-up to #1097.
We make
simple_write_deployment
smart enough so that it can be used forrpm-ostree's purposes. This is mostly an upstreaming of logic that
already existed there.
Notably we correctly append
NOT_DEFAULT
deployments after the booteddeployment and we now support
RETAIN_PENDING
andRETAIN_ROLLBACK
flagsto have more granularity on deployment pruning.
Expose these new flags on the CLI using new options (as well as expose
the previously existing
NOT_DEFAULT
flag as--not-as-default
).I couldn't add tests for
--retain-pending
because the merge deploymentis always the topmost one. Though I did check that it worked in a VM.