-
Notifications
You must be signed in to change notification settings - Fork 293
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?
Conversation
25196b8
to
86ef105
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2077 +/- ##
==========================================
- Coverage 79.72% 79.52% -0.19%
==========================================
Files 176 176
Lines 13263 13300 +37
==========================================
+ Hits 10573 10576 +3
- Misses 2021 2048 +27
- Partials 669 676 +7
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: Prashant Rewar <[email protected]>
86ef105
to
7b1f5cf
Compare
@@ -51,7 +51,7 @@ func Rebase(logger logging.Logger, cfg config.Config, pack PackClient) *cobra.Co | |||
cmd.Flags().StringVar(&policy, "pull-policy", "", "Pull policy to use. Accepted values are always, never, and if-not-present. The default is always") | |||
cmd.Flags().StringVar(&opts.ReportDestinationDir, "report-output-dir", "", "Path to export build report.toml.\nOmitting the flag yield no report file.") | |||
cmd.Flags().BoolVar(&opts.Force, "force", false, "Perform rebase operation without target validation (only available for API >= 0.12)") | |||
|
|||
cmd.Flags().StringSliceVarP(&opts.InsecureRegistries, "insecure-registry", "", nil, "List of insecure registries") |
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.
cmd.Flags().StringSliceVarP(&opts.InsecureRegistries, "insecure-registry", "", nil, "List of insecure registries (only available for API >= 0.13)")
@@ -231,7 +239,7 @@ func NewClient(opts ...Option) (*Client, error) { | |||
} | |||
|
|||
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 comment
The 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, client.insecureRegistries
is always going to be empty. because this option is never called when we initialized the client
.
Usually, the client is being initialized with configuration we save in the pack configuration file, see pack config
command. In this case, the insecure-registries
are configured at runtime when the user invokes the pack build
or pack rebase
commands, but at that point in time, the client was already initialized and the image fetcher was already created.
I think we need a way to passthrough the insecure-registries
to the Fetch
method at runtime
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.
@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 comment
The 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.
Signed-off-by: Juan Bustamante <[email protected]>
Any further updates here? |
Hi, @prashantrewar! Do you have some bandwidth to take a look at this? |
@jjbustamante Sorry, recently I'm busy with something else. |
Summary
Output
Before
After
Documentation
Related
Resolves #1916