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

Split the registry client out so it can be used in more places #17994

Merged

Conversation

smarterclayton
Copy link
Contributor

The client was previously in pkg/image/importer but isn't specific to
import. It's really a factory for working with arbitrary registries for
both push and pull, so move it into its own package and trim its
dependency set down to only docker/distribution, which makes it more
portable to different codebases.

@bparees helps use this code in more places

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 4, 2018
@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 4, 2018
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 4, 2018
@bparees
Copy link
Contributor

bparees commented Jan 4, 2018

+1

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Left you some comments, I don't see a WIP next to the PR title, so I'm assuming it's ready for review.

@@ -0,0 +1,86 @@
package registryclient
Copy link
Contributor

Choose a reason for hiding this comment

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

You're copy&pasting this (at least parts) from pkg/image/importer/credentials.go but I don't see that file (those bits) being removed?

type noopCredentialStore struct{}

func (s *noopCredentialStore) Basic(url *url.URL) (string, string) {
glog.Infof("asked to provide Basic credentials for %s", url)
Copy link
Contributor

Choose a reason for hiding this comment

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

While you're at it please remove these debug statements here and in the next few functions.

@mfojtik
Copy link
Contributor

mfojtik commented Jan 5, 2018

@smarterclayton is the intention to use the client in registry as well (I think registry also has its own client...?). If so, don't we want to extract this into separate repo or something that is vendorable?

@bparees
Copy link
Contributor

bparees commented Jan 5, 2018

@smarterclayton is the intention to use the client in registry as well (I think registry also has its own client...?). If so, don't we want to extract this into separate repo or something that is vendorable?

image-registry uses this client already (by vendoring origin) as i understand it. So yes, moving it to a shared repository so it's vendorable would be ideal but that's also true for a bunch of other code and i don't think we're in a position to take on that refactor 5 days before feature cut.

The client was previously in pkg/image/importer but isn't specific to
import. It's really a factory for working with arbitrary registries for
both push and pull, so move it into its own package and trim its
dependency set down to only docker/distribution, which makes it more
portable to different codebases.
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smarterclayton

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@smarterclayton
Copy link
Contributor Author

Updated. I split out more so the dependency tree is a lot clearer. registry client depends on docker distribution. registryclient/dockercredentials depends on kubernetes/pkg/credentialprovider. image/importer has anything kube api dependent.

_ "github.com/openshift/origin/pkg/api/install"
)

type mockKeyring struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as before, please remove these duplicates from pkg/image/importer/credentials_test.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are local private types. They aren't duplicates, since we can't import them.

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

One more nit and you're good to go.

@smarterclayton smarterclayton added the lgtm Indicates that a PR is ready to be merged. label Jan 9, 2018
@smarterclayton
Copy link
Contributor Author

Tagging based on not being able to export these things.

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 17737, 18023, 17994).

@openshift-merge-robot openshift-merge-robot merged commit 68ce80a into openshift:master Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants