From 2f98b7717107546be6c37a92068c420fb0a734d9 Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Mon, 18 Dec 2023 14:21:38 +0000 Subject: [PATCH] fix: don't override storage driver useragent if it's set Signed-off-by: Milos Gajdos --- registry/handlers/app.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/registry/handlers/app.go b/registry/handlers/app.go index 6866eb82..64e49e41 100644 --- a/registry/handlers/app.go +++ b/registry/handlers/app.go @@ -113,7 +113,9 @@ func NewApp(ctx context.Context, config *configuration.Configuration) *App { if storageParams == nil { storageParams = make(configuration.Parameters) } - storageParams["useragent"] = fmt.Sprintf("distribution/%s %s", version.Version, runtime.Version()) + if storageParams["useragent"] == "" { + storageParams["useragent"] = fmt.Sprintf("distribution/%s %s", version.Version, runtime.Version()) + } var err error app.driver, err = factory.Create(app, config.Storage.Type(), storageParams)