Skip to content

Commit

Permalink
daemon/upgrader: Print OSTree signature verification text when pullin…
Browse files Browse the repository at this point in the history
…g OCI

If using OSTree remote signature verification for an OCI pull, print the
verification text we get from ostree-ext.
  • Loading branch information
jlebon committed Jan 17, 2025
1 parent c424510 commit f1fc6a3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions rpmostree-cxxrs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,7 @@ struct ContainerImageState final
::rust::String image_digest;
::rust::String version;
::rpmostreecxx::ExportedManifestDiff cached_update_diff;
::rust::String verify_text;

using IsRelocatable = ::std::true_type;
};
Expand Down
1 change: 1 addition & 0 deletions rpmostree-cxxrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,7 @@ struct ContainerImageState final
::rust::String image_digest;
::rust::String version;
::rpmostreecxx::ExportedManifestDiff cached_update_diff;
::rust::String verify_text;

using IsRelocatable = ::std::true_type;
};
Expand Down
1 change: 1 addition & 0 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ pub mod ffi {
pub image_digest: String,
pub version: String,
pub cached_update_diff: ExportedManifestDiff,
pub verify_text: String,
}

#[derive(Debug, Default)]
Expand Down
1 change: 1 addition & 0 deletions rust/src/sysroot_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ impl From<Box<ostree_container::store::LayeredImageState>> for crate::ffi::Conta
image_digest: s.manifest_digest.to_string(),
version,
cached_update_diff,
verify_text: s.verify_text.unwrap_or_default(),
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/daemon/rpmostree-sysroot-upgrader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ rpmostree_sysroot_upgrader_pull_base (RpmOstreeSysrootUpgrader *self, const char
rpmostreecxx::pull_container (*self->repo, *cancellable, r.refspec.c_str ()),
error);

if (!import->verify_text.empty ())
rpmostree_output_message ("%s", import->verify_text.c_str ());
new_base_rev = g_strdup (import->merge_commit.c_str ());
}
break;
Expand Down

0 comments on commit f1fc6a3

Please sign in to comment.