Skip to content

Commit a367a7a

Browse files
committed
clairctl: use a better user-agent
Signed-off-by: Hank Donnay <[email protected]>
1 parent 25ac033 commit a367a7a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

cmd/clairctl/client.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@ import (
1818
"github.com/quay/zlog"
1919
"github.com/tomnomnom/linkheader"
2020

21+
"github.com/quay/clair/v4/cmd"
2122
"github.com/quay/clair/v4/httptransport"
2223
"github.com/quay/clair/v4/internal/codec"
2324
"github.com/quay/clair/v4/internal/httputil"
2425
)
2526

26-
const (
27-
userAgent = `clairctl/1`
28-
)
29-
3027
var (
3128
rtMu sync.Mutex
3229
rtMap = map[string]http.RoundTripper{}
@@ -50,7 +47,7 @@ func rt(ctx context.Context, ref string) (http.RoundTripper, error) {
5047
return nil, err
5148
}
5249
rt := http.DefaultTransport
53-
rt = transport.NewUserAgent(rt, userAgent)
50+
rt = transport.NewUserAgent(rt, `clairctl/`+cmd.Version)
5451
rt = transport.NewRetry(rt)
5552
rt, err = transport.NewWithContext(ctx, repo.Registry, auth, rt, []string{repo.Scope(transport.PullScope)})
5653
if err != nil {

0 commit comments

Comments
 (0)