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

bootc status --booted does not show booted deployment only #465

Open
henrywang opened this issue Apr 10, 2024 · 1 comment
Open

bootc status --booted does not show booted deployment only #465

henrywang opened this issue Apr 10, 2024 · 1 comment

Comments

@henrywang
Copy link
Contributor

bootc status --booted shows both booted and rollback deployments.
bootc version: bootc-202404082017.g593a932258-1.el9.x86_64

    apiVersion: org.containers.bootc/v1alpha1
    kind: BootcHost
    metadata:
      name: host
    spec:
      image:
        image: quay.io/redhat_emp1/centos-bootc-dev-test:efvi
        transport: registry
      bootOrder: default
    status:
      staged: null
      booted:
        image:
          image:
            image: quay.io/redhat_emp1/centos-bootc-dev-test:efvi
            transport: registry
          version: stream9.20240408.0
          timestamp: null
          imageDigest: sha256:321f50bfe1d7357b96c5ae1bd167a73c8e35da3148c588647e28706af2f84ba6
        cachedUpdate: null
        incompatible: false
        pinned: false
        ostree:
          checksum: ef81c60b6c0e7c3646b2065b8a2fa820583d047dff2af5bb393f2de3a7fdb159
          deploySerial: 0
      rollback:
        image:
          image:
            image: localhost/centos-bootc-dev-test:efvi
            transport: registry
          version: stream9.20240408.0
          timestamp: null
          imageDigest: sha256:8567933fb840bd38804f9f0226d6edec9630d46506cdf83347152ee6961ec621
        cachedUpdate: null
        incompatible: false
        pinned: false
        ostree:
          checksum: daf537165510cd1c77b389a38d3cce5c0cd20bb83594219b3d57b6df833376dd
          deploySerial: 0
      rollbackQueued: false
      type: bootcHost
@jeckersb
Copy link
Contributor

Confirmed, the code for the status command doesn't consult that flag at all today:

bootc/lib/src/status.rs

Lines 302 to 327 in 593a932

/// Implementation of the `bootc status` CLI command.
#[context("Status")]
pub(crate) async fn status(opts: super::cli::StatusOpts) -> Result<()> {
let host = if !Utf8Path::new("/run/ostree-booted").try_exists()? {
Default::default()
} else {
crate::cli::require_root()?;
let sysroot = super::cli::get_locked_sysroot().await?;
let booted_deployment = sysroot.booted_deployment();
let (_deployments, host) = get_status(&sysroot, booted_deployment.as_ref())?;
host
};
// If we're in JSON mode, then convert the ostree data into Rust-native
// structures that can be serialized.
// Filter to just the serializable status structures.
let out = std::io::stdout();
let mut out = out.lock();
if opts.json {
serde_json::to_writer(&mut out, &host).context("Writing to stdout")?;
} else {
serde_yaml::to_writer(&mut out, &host).context("Writing to stdout")?;
}
Ok(())
}

The --booted flag is available in StatusOpts.booted, but note the only thing we consult in opts above is the json flag; the booted flag is never read.

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

No branches or pull requests

2 participants