Fix http registry oci pull (#4701)

Signed-off-by: alexey.makhonin <alexey.makhonin@flant.com>
This commit is contained in:
Makhonin Alexey
2023-06-26 15:40:40 +03:00
committed by GitHub
parent 5d73b47dbc
commit 9be08253a2

View File

@@ -78,7 +78,12 @@ func (a *Artifact) populate(ctx context.Context, opt types.RegistryOptions) erro
a.m.Lock()
defer a.m.Unlock()
ref, err := name.ParseReference(a.repository)
var nameOpts []name.Option
if opt.Insecure {
nameOpts = append(nameOpts, name.Insecure)
}
ref, err := name.ParseReference(a.repository, nameOpts...)
if err != nil {
return xerrors.Errorf("repository name error (%s): %w", a.repository, err)
}