-
Notifications
You must be signed in to change notification settings - Fork 288
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
Support Insecure Registries #2077
base: main
Are you sure you want to change the base?
Changes from 2 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 |
---|---|---|
|
@@ -102,9 +102,10 @@ | |
lifecycleExecutor LifecycleExecutor | ||
buildpackDownloader BuildpackDownloader | ||
|
||
experimental bool | ||
registryMirrors map[string]string | ||
version string | ||
experimental bool | ||
registryMirrors map[string]string | ||
version string | ||
insecureRegistries []string | ||
jjbustamante marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
// Option is a type of function that mutate settings on the client. | ||
|
@@ -187,6 +188,13 @@ | |
} | ||
} | ||
|
||
// WithInsecureRegistries sets insecure registry to pull images from. | ||
func WithInsecureRegistries(insecureRegistries []string) Option { | ||
return func(c *Client) { | ||
c.insecureRegistries = insecureRegistries | ||
} | ||
} | ||
|
||
// WithKeychain sets keychain of credentials to image registries | ||
func WithKeychain(keychain authn.Keychain) Option { | ||
return func(c *Client) { | ||
|
@@ -231,7 +239,7 @@ | |
} | ||
|
||
if client.imageFetcher == nil { | ||
client.imageFetcher = image.NewFetcher(client.logger, client.docker, image.WithRegistryMirrors(client.registryMirrors), image.WithKeychain(client.keychain)) | ||
client.imageFetcher = image.NewFetcher(client.logger, client.docker, image.WithRegistryMirrors(client.registryMirrors), image.WithKeychain(client.keychain), image.WithInsecureRegistries(client.insecureRegistries)) | ||
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. I think there is a misunderstood with this code, for what I can see, Usually, the client is being initialized with configuration we save in the pack configuration file, see I think we need a way to passthrough the 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. @prashantrewar Do you have a chance to take a look at this? 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. I apologize @jjbustamante, right now I am busy with something, on the weekend I will try to fix it. |
||
} | ||
|
||
if client.imageFactory == 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.
I think, I will add something similar to the
--force
flag.