fix: don't override storage driver useragent if it's set (#4195)

This commit is contained in:
Milos Gajdos 2023-12-18 16:45:01 +00:00 committed by GitHub
commit 35bda96521
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)