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

ostree-sysroot: make simple_write_deployment smarter #1110

Closed

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Aug 23, 2017

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.

jlebon added 2 commits August 23, 2017 17:48
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.
@cgwalters
Copy link
Member

cgwalters commented Aug 24, 2017

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.

@cgwalters
Copy link
Member

Usage in coreos/rpm-ostree#942

* to put the new deployment right after the current default in the
* order.
*/
if (!added_new)
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Fixed in ⬇️!

@cgwalters
Copy link
Member

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.

@rh-atomic-bot r+ d3dc8e7

@rh-atomic-bot
Copy link

⌛ Testing commit d3dc8e7 with merge 9342be6...

rh-atomic-bot pushed a commit that referenced this pull request Aug 25, 2017
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
@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: cgwalters
Pushing 9342be6 to master...

@jlebon jlebon deleted the pr/simple-deploy-more-retain-flags branch September 13, 2017 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants