Skip to content

Conversation

@ckyrouac
Copy link
Collaborator

@ckyrouac ckyrouac commented Jul 30, 2025

This allows the use of oci-archive when the archive doesn't yet exist.

fixes #5442

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the logic for checking existing OCI images to better handle the oci-archive transport, especially when the archive file doesn't exist. The change uses proxy.open_image instead of proxy.open_image_optional for this transport. A new test case is added to test.sh to verify this functionality. The review suggests improving error handling in the Rust code and ensuring test hygiene in the shell script.

Comment on lines +432 to +436
let img = if transport == OCI_ARCHIVE_TRANSPORT {
(proxy.open_image(output).await).ok()
} else {
proxy.open_image_optional(output).await?
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using .ok() here swallows errors from proxy.open_image().await, treating any failure as if the image does not exist. This could mask underlying issues such as permissions errors or invalid paths, leading to unexpected behavior.

It would be more robust to handle only the "not found" case as a non-error condition and propagate other errors. At a minimum, logging the discarded error at a debug level would aid in troubleshooting potential issues in the future.

            let img = if transport == OCI_ARCHIVE_TRANSPORT {
                match proxy.open_image(output).await {
                    Ok(img) => Some(img),
                    Err(e) => {
                        tracing::debug!("Ignoring error opening oci-archive: {e}");
                        None
                    }
                }
            } else {
                proxy.open_image_optional(output).await?
            };

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this as a followup

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote a helper for this bootc-dev/bootc#1464

This allows the use of oci-archive when the archive doesn't yet exist.

Signed-off-by: ckyrouac <[email protected]>
@cgwalters
Copy link
Member

/override ci/prow/fcos-e2e

@cgwalters cgwalters enabled auto-merge July 30, 2025 18:48
@openshift-ci
Copy link

openshift-ci bot commented Jul 30, 2025

@cgwalters: Overrode contexts on behalf of cgwalters: ci/prow/fcos-e2e

In response to this:

/override ci/prow/fcos-e2e

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@cgwalters cgwalters disabled auto-merge July 30, 2025 19:04
@cgwalters cgwalters enabled auto-merge July 30, 2025 19:05
@cgwalters cgwalters merged commit 47f6616 into coreos:main Jul 30, 2025
19 of 20 checks passed
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

Successfully merging this pull request may close these issues.

chunking fails with nonexistent oci-archive

3 participants