Skip to content

lib: Set user agent header for container image pulls#1943

Merged
jeckersb merged 1 commit intobootc-dev:mainfrom
cgwalters:useragent
Jan 23, 2026
Merged

lib: Set user agent header for container image pulls#1943
jeckersb merged 1 commit intobootc-dev:mainfrom
cgwalters:useragent

Conversation

@cgwalters
Copy link
Collaborator

This allows registries to distinguish "image pulls for bootc client runs" from other skopeo/containers-image users. The user agent will be in the format "bootc/ skopeo/".

All places in bootc that create ImageProxyConfig now use a new helper function that sets the user_agent_prefix field.

Closes: #1686
Assisted-by: OpenCode (Sonnet 4)

@github-actions github-actions bot added area/install Issues related to `bootc install` area/ostree Issues related to ostree labels Jan 22, 2026
@bootc-bot bootc-bot bot requested a review from jeckersb January 22, 2026 23:17
Copy link
Contributor

@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 introduces a change to set a custom User-Agent header for all container image pulls made by bootc. This is achieved by adding a new helper function new_proxy_config that creates an ImageProxyConfig with the user_agent_prefix set to bootc/<version>. This function is now used consistently across the codebase wherever an ImageProxyConfig is needed. The containers-image-proxy dependency has been updated to 0.9.1 to support this feature.

The changes are well-implemented and include a new integration test to verify the User-Agent header. My only suggestion is to improve the new test script by using a dynamically allocated port instead of a hardcoded one to prevent potential flakiness in test environments.

This allows registries to distinguish "image pulls for bootc client
runs" from other skopeo/containers-image users. The user agent will
be in the format "bootc/<version> skopeo/<version>".

All places in bootc that create ImageProxyConfig now use a new helper
function that sets the user_agent_prefix field.

Closes: bootc-dev#1686
Assisted-by: OpenCode (Sonnet 4)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters
Copy link
Collaborator Author

One thing I realized here is when we get to unified storage we're probably going to need to patch podman with a similar user agent override.

Copy link
Collaborator

@jeckersb jeckersb left a comment

Choose a reason for hiding this comment

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

LGTM, I see this has the xtask tmt sorting issue showing up in the diff, but I am reasonably sure (after simulating the merge manually) that the final result should be correct and we're not going to perpetuate the sort issue any further.

@jeckersb jeckersb merged commit 1d8cf09 into bootc-dev:main Jan 23, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install Issues related to `bootc install` area/ostree Issues related to ostree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

set user agent header

2 participants