Skip to content

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
 

‎pkg/registry/client.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ an underscore (_) in chart version tags when pushing to a registry and back to
5151
a plus (+) when pulling from a registry.`
5252

5353
type (
54+
// RemoteClient shadows the ORAS remote.Client interface
55+
// (hiding the ORAS type from Helm client visibility)
56+
// https://pkg.go.dev/oras.land/oras-go/pkg/registry/remote#Client
57+
RemoteClient interface {
58+
Do(req *http.Request) (*http.Response, error)
59+
}
60+
5461
// Client works with OCI-compliant registries
5562
Client struct {
5663
debug bool
@@ -61,7 +68,7 @@ type (
6168
password string
6269
out io.Writer
6370
authorizer auth.Client
64-
registryAuthorizer *registryauth.Client
71+
registryAuthorizer RemoteClient
6572
resolver func(ref registry.Reference) (remotes.Resolver, error)
6673
httpClient *http.Client
6774
plainHTTP bool
@@ -220,7 +227,7 @@ func ClientOptAuthorizer(authorizer auth.Client) ClientOption {
220227
// can be used to override the default authorization mechanism.
221228
//
222229
// Depending on the use-case you may need to set both ClientOptAuthorizer and ClientOptRegistryAuthorizer.
223-
func ClientOptRegistryAuthorizer(registryAuthorizer *registryauth.Client) ClientOption {
230+
func ClientOptRegistryAuthorizer(registryAuthorizer RemoteClient) ClientOption {
224231
return func(client *Client) {
225232
client.registryAuthorizer = registryAuthorizer
226233
}

0 commit comments

Comments
 (0)
Please sign in to comment.