-
Notifications
You must be signed in to change notification settings - Fork 155
lib: Add --download-only flag for upgrade (ostree backend) #1831
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
Conversation
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.
Code Review
This pull request introduces a --download-only flag for the bootc upgrade command, allowing users to download and stage updates without automatic application on reboot. This is implemented using OSTree's finalization locking mechanism. The changes are comprehensive, touching the CLI, deployment logic, status reporting, and adding necessary bindings for the ostree library. Documentation, man pages, and JSON schemas have been updated accordingly, and a new integration test validates the core functionality. The implementation appears solid. My review includes a couple of suggestions to enhance the new integration test to be more explicit and robust.
aff0e03 to
fe7dae7
Compare
cgwalters
left a comment
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.
Thanks! This all looks pretty good to me at a high level
fe7dae7 to
84a2837
Compare
84a2837 to
f9a4ba9
Compare
Add support for downloading and staging updates without automatic application on reboot. This allows users to prepare updates and apply them at a controlled time. User-facing changes: - Add --download-only flag to bootc upgrade command - bootc upgrade --download-only: stages deployment in download-only mode - bootc upgrade (no flags): clears download-only mode if present - bootc upgrade --apply: clears download-only mode and immediately reboots - bootc upgrade --check: read-only, doesn't change download-only state - bootc status shows "Download-only: yes/no" for staged deployments in verbose mode - Garbage collection automatically cleans up unreferenced images after staging Implementation details: - Internally uses OSTree finalization locking APIs - Sets opts.locked in SysrootDeployTreeOpts when staging deployments - Added change_finalization() method to SysrootLock wrapper - Tracks lock state changes separately from image digest changes - Field name in BootEntry is download_only (Rust), downloadOnly (JSON) - Verbose status display uses "Download-only" label (matches Soft-reboot pattern) - Uses deployment.is_finalization_locked() API (OSTree v2023.8+) - Always emits downloadOnly field in JSON output for consistency Testing and documentation: - New dedicated test: test-25-download-only-upgrade.nu (4-boot workflow) - Test verifies: switch → upgrade --download-only → reboot (stays old) → re-stage → upgrade (clear) → reboot (applies) - Updated docs/src/upgrades.md with comprehensive workflow examples - Includes notes about reboot behavior and image switching - Generated man pages and JSON schemas updated - All test fixtures updated with downloadOnly field The download-only flag is only available for upgrade, not switch. The implementation is designed to support future composefs backend. Assisted-by: Claude Code (Sonnet 4.5) Signed-off-by: Wei Shi <wshi@redhat.com>
f9a4ba9 to
b023059
Compare
|
@cgwalters I still cannot find a good solution to integrate this upgrade-download-only test into the existing image-upgrade-reboot test, that's because image-upgrade-reboot design to work both ways (the upgrade image is pre-built and passthough via Let me know if anything else need to be done to get this PR merged. |
cgwalters
left a comment
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.
LGTM!
Resolve #1320 for the ostree backend
Add support for downloading and staging updates without automatic application on reboot. This allows users to prepare updates and apply them at a controlled time.
User-facing changes:
Implementation details:
Testing and documentation:
The download-only flag is only available for upgrade, not switch. The implementation is designed to support future composefs backend.
Assisted-by: Claude Code (Sonnet 4.5)