Skip to content

Commit

Permalink
initialize: update call to Libindex contstructor
Browse files Browse the repository at this point in the history
A recent claircore change now requires an *http.Client in the Libindex
constructor.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed May 11, 2021
1 parent c80a99d commit 5df82e1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion initialize/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,16 @@ func localIndexer(ctx context.Context, cfg *config.Config) (indexer.Service, err
opts.ScannerConfig.Repo[name] = node.Decode
}
}
s, err := libindex.New(ctx, &opts)
tr := http.DefaultTransport.(*http.Transport).Clone()
// Use an empty claim because this shouldn't be talking to something that
// needs preconfigured authz. Callers should be providing credentials to the
// indexing process in the submitted manifest.
c, _, err := cfg.Client(tr, jwt.Claims{})
if err != nil {
return nil, mkErr(err)
}

s, err := libindex.New(ctx, &opts, c)
if err != nil {
return nil, mkErr(err)
}
Expand Down

0 comments on commit 5df82e1

Please sign in to comment.