Closed dlion closed 11 months ago
So just to be aligned, shall we add remote.WithRegistrySetting("myotherregistry.com", true)
loops (as we have done in lifecycle) in those functions as well? Did I understand correctly?
From the outside I would expect to be able to do this and have the remote.WithTransport
use the correct reg.insecure
value.
remoteImage, err := remote.NewImage("myregistry.domain.com/repo/app-image",
authn.DefaultKeychain,
remote.FromBaseImage("myother-insecure-registry.com/repo/superbase"),
remote.WithRegistrySetting("myregistry.domain.com", true),
remote.WithRegistrySetting("myother-insecure-registry.com", true),
)
I see map[string]registrySetting
already in getRegistry
- If we update remote.WithRegistrySetting
to not override the entire map it may just work. Everything reads ok to me.
@natalieparellano I will leave for you to review as well.
@jabrown85 now I got it! Thanks for clarifying. Yes you are right, the actual implementation reset the map every time, preventing having multiple registries, and the test we currently have test just one registry. 😅 I'll update this PR fixing the map initialization and extending the test with the check for multiple registries.
Thank you again for spotting it 😁
@jabrown85 has spotted some points in the
imgutil
library where theinsecureSkipVerify
flag should be necessary.This PR is addressing that.
Thank you @jabrown85!