Repository navigation
Open
Description
If you define a /etc/containers/policy.json in a bootc image, and update this policy in a new image, bootc upgrade will reads the bound images from the new deployment:
bootc/crates/lib/src/boundimage.rs
Lines 41 to 59 in 7cde7bb
| pub(crate) async fn pull_bound_images(sysroot: &Storage, deployment: &Deployment) -> Result<()> { | |
| // Log the bound images operation to systemd journal | |
| const BOUND_IMAGES_JOURNAL_ID: &str = "1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5"; | |
| tracing::info!( | |
| message_id = BOUND_IMAGES_JOURNAL_ID, | |
| bootc.deployment.osname = deployment.osname().as_str(), | |
| bootc.deployment.checksum = deployment.csum().as_str(), | |
| "Starting pull of bound images for deployment" | |
| ); | |
| let ostree = sysroot.get_ostree()?; | |
| let bound_images = query_bound_images_for_deployment(ostree, deployment)?; | |
| tracing::info!( | |
| message_id = BOUND_IMAGES_JOURNAL_ID, | |
| bootc.bound_images_count = bound_images.len(), | |
| "Found {} bound images to pull", | |
| bound_images.len() | |
| ); | |
| pull_images(sysroot, bound_images).await |
but pulls them with the booted system's /etc/containers/policy.json:
bootc/crates/lib/src/podstorage.rs
Lines 459 to 475 in 7cde7bb
| pub(crate) async fn pull(&self, image: &str, mode: PullMode) -> Result<bool> { | |
| match mode { | |
| PullMode::IfNotExists => { | |
| if self.exists(image).await? { | |
| tracing::debug!("Image is already present: {image}"); | |
| return Ok(false); | |
| } | |
| } | |
| PullMode::Always => {} | |
| }; | |
| let mut cmd = self.new_image_cmd()?; | |
| cmd.stdin(Stdio::null()); | |
| cmd.stdout(Stdio::null()); | |
| cmd.args(["pull", image]); | |
| tracing::debug!("Pulling image: {image}"); | |
| let mut cmd = AsyncCommand::from(cmd); | |
| cmd.run().await.context("Failed to pull image")?; |
So an image that adds a bound image and allows it in its own policy.json can't be upgraded to:
Source image rejected: Running image docker://ghcr.io/example/app@sha256:… is rejected by policy.
Expected: use the new deployment's policy (podman pull --signature-policy).
bootc 1.17.1, same code in v1.17.4.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Johan-Liebert1 commentedon Nov 24, 2026
This has some intersection with #2679. I can pick it up one it's merged