Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Fix registry insecure flag
Browse files Browse the repository at this point in the history
Fixes #3333
  • Loading branch information
izeau committed Aug 16, 2023
1 parent 01b5f91 commit 0ffb375
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/pkg/epinject/ociregistry/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ func (s *Server) getClient(ctx context.Context, repoStr string) (*http.Client, e
// auth as well as the bearer token protocol used when the server returns WWW-Authenticate.
// Plus it's well tested.

repo, err := name.NewRepository(repoStr)
opts := []name.Option{}
if strings.HasPrefix(s.Upstream, "http://") {
opts = append(opts, name.Insecure)
}

repo, err := name.NewRepository(repoStr, opts...)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 0ffb375

Please sign in to comment.