Skip to content

Add support for platform parameter in image push #3325

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Khushiyant
Copy link
Contributor

Closes #3324

Adds the following:

  • add platform parameter handling in images.api.push
  • add tests in tests/unit/api_image_test.py::ImageTest::test_push_image_with_platform

platform parameter was introduced in v1.46

@Khushiyant Khushiyant force-pushed the image-push-platform branch from 3dd9b4f to 2356a17 Compare March 28, 2025 13:49
@hoangelos
Copy link

Any chance someone can look at this? This causing a bug for me. What happens without this is tags can’t be pushed to registries. Only the sha. Say I copy a docker image from one registry to another. You want to copy a specific platform, then it won’t push the tag without specifying the platform.

@@ -448,6 +448,7 @@ def push(self, repository, tag=None, stream=False, auth_config=None,
``username`` and ``password`` keys to be valid.
decode (bool): Decode the JSON data from the server into dicts.
Only applies with ``stream=True``
platform (str): JSON-encoded OCI platform to select the platform-variant to push. If not provided, all available variants will attempt to be pushed.
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 expected to be a JSON-encoded at the API level. But at the SDK level, it would probably be better if it was an instance of a nicer "Platform" class/struct.

Choose a reason for hiding this comment

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

Whatever the case shouldn’t it match the pull? There shouldn’t be a string in one and class in another.

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.

Support for platform in client.images.api.push
3 participants