-
Notifications
You must be signed in to change notification settings - Fork 4.7k
registry: use generated imagestream clientset to retrieve secrets #16098
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,29 +3,26 @@ package client | |
import ( | ||
kcoreclient "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/internalversion" | ||
|
||
"github.com/openshift/origin/pkg/client" | ||
imageclientv1 "github.com/openshift/origin/pkg/image/generated/clientset/typed/image/v1" | ||
) | ||
|
||
type fakeRegistryClient struct { | ||
RegistryClient | ||
|
||
client client.Interface | ||
images imageclientv1.ImageV1Interface | ||
} | ||
|
||
func NewFakeRegistryClient(c client.Interface, imageclient imageclientv1.ImageV1Interface) RegistryClient { | ||
func NewFakeRegistryClient(imageclient imageclientv1.ImageV1Interface) RegistryClient { | ||
return &fakeRegistryClient{ | ||
RegistryClient: ®istryClient{}, | ||
client: c, | ||
images: imageclient, | ||
} | ||
} | ||
|
||
func (c *fakeRegistryClient) Client() (Interface, error) { | ||
return newAPIClient(c.client, nil, nil, c.images, nil), nil | ||
return newAPIClient(nil, nil, c.images, nil), nil | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dmage as part of the test client refactoring we should get rid of all this nils and just pass the clients we actually use (I believe we use just images client). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We just don't have unit tests for the paths with other clients (e.g., limit ranges). If we have better code coverage, we will not have nils there. |
||
} | ||
|
||
func NewFakeRegistryAPIClient(c client.Interface, kc kcoreclient.CoreInterface, imageclient imageclientv1.ImageV1Interface) Interface { | ||
return newAPIClient(c, nil, nil, imageclient, nil) | ||
func NewFakeRegistryAPIClient(kc kcoreclient.CoreInterface, imageclient imageclientv1.ImageV1Interface) Interface { | ||
return newAPIClient(nil, nil, imageclient, nil) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
k8s.io/client-go/rest.AnonymousClientConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.