Skip to content

Add bootc discard-staged to safely cancel a pending deployment #2660

Open

Description

@alicefr

Description

Bootc currently lacks a dedicated way to discard a staged deployment while keeping the currently booted image as the next-boot default. bootc rollback discards staging but queues the rollback image instead. This matters when a staged image fails a newly applied signature policy: skipping an agent-initiated reboot is insufficient because an unrelated reboot may still apply it. See CVE-2026-16460. This mechanism will also benefit the bootc-operator, since a signature policy could change between the time the deployment was staged and the reboot, this will enable the bootc-operator to discard the deployment.

Expected behavior

  • Works with OSTree and composefs backends, including ordinary and --download-only stages.
  • Leaves booted image selected for next boot; preserves rollback deployment.
  • Is safe and idempotent when no stage exists.
  • Handles concurrent staging safely and documents how the tracked image reference changes.
  • After success, bootc status shows no staged deployment; an unrelated reboot cannot apply the discarded image.
  • Includes tests for both backends and next-boot behavior.

Activity

  1. Johan-Liebert1 commented on Nov 30, 2026

    @Johan-Liebert1
    Member

    This could be achieved as a workaround in the following way, of course that's not a replacement for an actual API

    For composefs backend

    staged=$(bootc status --json | jq '.status.staged?.composefs?.verity')
    
    if [[ "$staged" != "null" ]]; then bootc delete-deployment $staged; fi;

    For ostree

    staged=$(bootc status --json | jq '.status.staged')
    
    if [[ "$staged" != "null" ]]; then ostree admin undeploy 0; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions