Skip to content

Commit 2269c1a

Browse files
yeetypetecgwalters
authored andcommitted
fix(composefs): merge default proxy opts for registry auth discovery
The composefs backend creates an ImageProxyConfig via new_proxy_config() in three places but never calls merge_default_container_proxy_opts(), so the global authfile (e.g. /etc/ostree/auth.json) is never discovered. This causes bootc upgrade, switch, and install to fail with "access denied on private registries when using the composefs backend. The ostree backend handles this correctly via ImageImporter::new() which calls merge_default_container_proxy_opts() internally. Signed-off-by: Peter Siegel <psiegel2000@icloud.com>
1 parent 28b557c commit 2269c1a

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/lib/src/bootc_composefs/repo.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ pub(crate) async fn initialize_composefs_repository(
5555
transport,
5656
} = &state.source.imageref;
5757

58+
let mut config = crate::deploy::new_proxy_config();
59+
ostree_ext::container::merge_default_container_proxy_opts(&mut config)?;
60+
5861
// transport's display is already of type "<transport_type>:"
5962
composefs_oci_pull(
6063
&Arc::new(repo),
6164
&format!("{transport}{image_name}"),
6265
None,
63-
None,
66+
Some(config),
6467
)
6568
.await
6669
}
@@ -120,7 +123,10 @@ pub(crate) async fn pull_composefs_repo(
120123

121124
tracing::debug!("Image to pull {final_imgref}");
122125

123-
let pull_result = composefs_oci_pull(&Arc::new(repo), &final_imgref, None, None)
126+
let mut config = crate::deploy::new_proxy_config();
127+
ostree_ext::container::merge_default_container_proxy_opts(&mut config)?;
128+
129+
let pull_result = composefs_oci_pull(&Arc::new(repo), &final_imgref, None, Some(config))
124130
.await
125131
.context("Pulling composefs repo")?;
126132

crates/lib/src/bootc_composefs/status.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ pub(crate) fn list_bootloader_entries(storage: &Storage) -> Result<Vec<String>>
317317
pub(crate) async fn get_container_manifest_and_config(
318318
imgref: &String,
319319
) -> Result<ImgConfigManifest> {
320-
let config = crate::deploy::new_proxy_config();
320+
let mut config = crate::deploy::new_proxy_config();
321+
ostree_ext::container::merge_default_container_proxy_opts(&mut config)?;
321322
let proxy = containers_image_proxy::ImageProxy::new_with_config(config).await?;
322323

323324
let img = proxy

0 commit comments

Comments
 (0)