Skip to content

Commit

Permalink
artifacts/oci: respect usage of implicit namespace (e.g. library)
Browse files Browse the repository at this point in the history
  • Loading branch information
edganiukov committed Jul 13, 2023
1 parent da81191 commit 7a7eb69
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/artifacts/oci/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,16 @@ func RefWithRegistryMirror(ctx context.Context, imageRef name.Reference) (name.R
fmt.Fprintf(console.Debug(ctx), "using mirror %q for registry %q\n", DockerHubMirror(), name.DefaultRegistry)

imageRepo := imageRef.Context()
mirrorRegistry, err := name.NewRegistry(mirrorHost, mirrorOpts...)
// We create a new repository here to have full name of repository (e.g. including 'library').
mirrorRepo, err := name.NewRepository(fmt.Sprintf("%s/%s", mirrorHost, imageRepo.RepositoryStr()), mirrorOpts...)
if err != nil {
return nil, err
}

imageRepo.Registry = mirrorRegistry
fmt.Fprintf(console.Debug(ctx), "using repository %q\n", mirrorRepo.Name())
return &imageReference{
Reference: imageRef,
repository: imageRepo,
repository: mirrorRepo,
}, nil
}

Expand Down

0 comments on commit 7a7eb69

Please sign in to comment.