Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(container-pull): add ability to add custom tag when copying to a registry #406

Merged
merged 4 commits into from
Mar 11, 2025

Conversation

carlosmmatos
Copy link
Contributor

Fixes #405

This PR introduces the --copy-custom-tag option for the container pull script that now allows a user to use a custom tag when copying an image to registry.

…a registry

Fixes CrowdStrike#405

This PR introduces the `--copy-custom-tag` option for the container pull
script that now allows a user to use a custom tag when copying an image
to registry.
@carlosmmatos carlosmmatos requested a review from evanstoner March 10, 2025 19:09
Copy link
Contributor

@redhatrises redhatrises left a comment

Choose a reason for hiding this comment

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

I think the only thing I would recommend is to come up with a different tag name other than latest.

@@ -743,7 +763,7 @@ if [ "$(is_multi_arch "$FULLIMAGEPATH")" = "true" ]; then
if [ -n "$SENSOR_PLATFORM" ]; then
# If Skopeo is being used, the platform must be overridden
if grep -qw "skopeo" "$CONTAINER_TOOL"; then
"$CONTAINER_TOOL" copy --override-arch "$(platform_override)" "docker://$FULLIMAGEPATH" "docker://$COPYPATH"
"$CONTAINER_TOOL" copy --override-arch "$(platform_override)" --override-os linux "docker://$FULLIMAGEPATH" "docker://$COPYPATH"
Copy link
Contributor

Choose a reason for hiding this comment

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

It's the override-os meant to be configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@redhatrises this is to prevent issues when using skopeo on macOS. W/O this it will think that your <os/platform> is incorrect so this is to ensure we say linux.. This doesn't impact Linux, I tested this and it works the same.

@carlosmmatos carlosmmatos merged commit da43e37 into CrowdStrike:main Mar 11, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bash container enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(container pull script) - allow the ability to use custom tags when copying images
3 participants