lib: Set user agent header for container image pulls#1943
lib: Set user agent header for container image pulls#1943jeckersb merged 1 commit intobootc-dev:mainfrom
Conversation
There was a problem hiding this comment.
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>
|
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. |
jeckersb
left a comment
There was a problem hiding this comment.
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.
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)