Skip to content

WRKLDS-1550: Add pkg/image/registryclient/v2 #1972

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 2 commits into
base: master
Choose a base branch
from

Conversation

tchap
Copy link

@tchap tchap commented Jun 10, 2025

This is a separate module that is compatible with
pkg/image/registryclient, but uses distribution/[email protected].

Since distribution/[email protected] has removed the client package being used
by library-go currently, or rather moved it into internal, this patch
includes copying the packages from distribution/v3/internal/client into
registryclient/v2/internal. Some of the logic is exported as required
to make oc work as that is where this patch has been tested.

So the approach taken was to copy registryclient into registryclient/v2,
then copy distribution/v3/internal/client into
registryclient/v2/internal, then keep exporting functionality so that oc
can be ported to distributions/[email protected] and registryclient/v2.

Generally when a project importing library-go wants to migrate to
the current distribution/v3, they can just import this module instead of
using pkg/image/registryclient. The interface is compatible with
pkg/image/registryclient and all that is needed is changing the import
path.

Note for the Reviewer

Although there is a lot of code, there is paradoxically not much to review. All code is actually copied from other sources and imports paths are amended so that the module works as a whole. Tests are also imported from the respective sources.

See openshift/oc#2036 to get the context.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 10, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jun 10, 2025

@tchap: This pull request references WRKLDS-1550 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set.

In response to this:

Add pkg/image/registryclient/v2
This is a separate module that is compatible with
pkg/image/registryclient, but uses distribution/[email protected].

Since distribution/[email protected] has removed the client package being used
by library-go currently, or rather moved it into internal, this patch
includes copying the packages from distribution/v3/internal/client into
registryclient/v2/internal. Some of the logic is exported as required
to make oc work as that is where this patch has been tested.

So the approach taken was to copy registryclient into registryclient/v2,
then copy distribution/v3/internal/client into
registryclient/v2/internal, then keep exporting functionality so that oc
can be ported to distributions/[email protected] and registryclient/v2.

Generally when a project importing library-go wants to migrate to
the current distribution/v3, they can just import this module instead of
using pkg/image/registryclient. The interface is compatible with
pkg/image/registryclient and all that is needed is changing the import
path.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jun 10, 2025

@tchap: This pull request references WRKLDS-1550 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set.

In response to this:

This is a separate module that is compatible with
pkg/image/registryclient, but uses distribution/[email protected].

Since distribution/[email protected] has removed the client package being used
by library-go currently, or rather moved it into internal, this patch
includes copying the packages from distribution/v3/internal/client into
registryclient/v2/internal. Some of the logic is exported as required
to make oc work as that is where this patch has been tested.

So the approach taken was to copy registryclient into registryclient/v2,
then copy distribution/v3/internal/client into
registryclient/v2/internal, then keep exporting functionality so that oc
can be ported to distributions/[email protected] and registryclient/v2.

Generally when a project importing library-go wants to migrate to
the current distribution/v3, they can just import this module instead of
using pkg/image/registryclient. The interface is compatible with
pkg/image/registryclient and all that is needed is changing the import
path.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Contributor

openshift-ci bot commented Jun 10, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tchap
Once this PR has been reviewed and has the lgtm label, please assign flavianmissi for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jun 10, 2025

@tchap: This pull request references WRKLDS-1550 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set.

In response to this:

This is a separate module that is compatible with
pkg/image/registryclient, but uses distribution/[email protected].

Since distribution/[email protected] has removed the client package being used
by library-go currently, or rather moved it into internal, this patch
includes copying the packages from distribution/v3/internal/client into
registryclient/v2/internal. Some of the logic is exported as required
to make oc work as that is where this patch has been tested.

So the approach taken was to copy registryclient into registryclient/v2,
then copy distribution/v3/internal/client into
registryclient/v2/internal, then keep exporting functionality so that oc
can be ported to distributions/[email protected] and registryclient/v2.

Generally when a project importing library-go wants to migrate to
the current distribution/v3, they can just import this module instead of
using pkg/image/registryclient. The interface is compatible with
pkg/image/registryclient and all that is needed is changing the import
path.

Note for the Reviewer

Although there is a lot of code, there is paradoxically not much to review. All code is actually copied from other sources and imports paths are amended so that the module works as a whole. Tests are also imported from the respective sources.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jun 10, 2025

@tchap: This pull request references WRKLDS-1550 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set.

In response to this:

This is a separate module that is compatible with
pkg/image/registryclient, but uses distribution/[email protected].

Since distribution/[email protected] has removed the client package being used
by library-go currently, or rather moved it into internal, this patch
includes copying the packages from distribution/v3/internal/client into
registryclient/v2/internal. Some of the logic is exported as required
to make oc work as that is where this patch has been tested.

So the approach taken was to copy registryclient into registryclient/v2,
then copy distribution/v3/internal/client into
registryclient/v2/internal, then keep exporting functionality so that oc
can be ported to distributions/[email protected] and registryclient/v2.

Generally when a project importing library-go wants to migrate to
the current distribution/v3, they can just import this module instead of
using pkg/image/registryclient. The interface is compatible with
pkg/image/registryclient and all that is needed is changing the import
path.

Note for the Reviewer

Although there is a lot of code, there is paradoxically not much to review. All code is actually copied from other sources and imports paths are amended so that the module works as a whole. Tests are also imported from the respective sources.

See openshift/oc#2036 to get the context.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@tchap
Copy link
Author

tchap commented Jun 10, 2025

/hold

until oc tests are fixed in the linked PR.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 10, 2025
@tchap tchap force-pushed the distribution-v3 branch from 015439e to 1964f70 Compare June 16, 2025 13:30
tchap added 2 commits June 20, 2025 10:26
This is a separate module that is compatible with
pkg/image/registryclient, but uses distribution/[email protected].

Since distribution/[email protected] has removed the client package being used
by library-go currently, or rather moved it into internal, this patch
includes copying the packages from distribution/v3/internal/client into
registryclient/v2/internal. Some of the logic is exported as required
to make oc work as that is where this patch has been tested.

So the approach taken was to copy registryclient into registryclient/v2,
then copy distribution/v3/internal/client into
registryclient/v2/internal, then keep exporting functionality so that oc
can be ported to distributions/[email protected] and registryclient/v2.

Generally when a project importing library-go wants to migrate to
the current distribution/v3, they can just import this module instead of
using pkg/image/registryclient. The interface is compatible with
pkg/image/registryclient and all that is needed is changing the import
path.
@tchap tchap force-pushed the distribution-v3 branch from 0ff528d to ef36034 Compare June 20, 2025 08:27
Copy link
Contributor

openshift-ci bot commented Jun 20, 2025

@tchap: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants