Skip to content

Add --distribution filter to container content list.#1443

Open
gerrod3 wants to merge 4 commits into
pulp:mainfrom
gerrod3:issue-2164-distribution-content-filter
Open

Add --distribution filter to container content list.#1443
gerrod3 wants to merge 4 commits into
pulp:mainfrom
gerrod3:issue-2164-distribution-content-filter

Conversation

@gerrod3

@gerrod3 gerrod3 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Resolve the served repository version from a distribution so users can list tags and other content for an image without manual lookup steps.

Ref: pulp/pulp_container#2164

@gerrod3 gerrod3 force-pushed the issue-2164-distribution-content-filter branch from 2d58f6b to 32a9791 Compare July 9, 2026 21:04
Resolve the served repository version from a distribution so users can list tags and other content for an image without manual lookup steps.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gerrod3 gerrod3 force-pushed the issue-2164-distribution-content-filter branch from 32a9791 to 0a58401 Compare July 9, 2026 21:07
Switching between repository and repository_version must complete the
clearing update before applying the new value to avoid API validation
errors under non-blocking updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@mdellweg mdellweg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should rebase and probably squash the last two commits.

Comment on lines +62 to +67
if "/container-push/" in repository_href:
repo_ctx: PulpRepositoryContext = PulpContainerPushRepositoryContext(
pulp_ctx, pulp_href=repository_href
)
else:
repo_ctx = PulpContainerRepositoryContext(pulp_ctx, pulp_href=repository_href)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The common base class wouldn't let us do this, right?

if version is not None:
if distribution["repository"]:
distribution_ctx.update(body={"repository": ""}, non_blocking=non_blocking)
distribution_ctx.update(body={"repository": ""}, non_blocking=False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does the server still not allow to update these in one go?

Comment on lines +74 to +75
if not distribution:
return

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How do you think about inverting the if here?
This currently looks like an if with only a disguised else branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants