fix: don't override storage driver useragent if it's set

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
Milos Gajdos 2023-12-18 14:21:38 +00:00
parent dfeaad7e3b
commit 2f98b77171
No known key found for this signature in database

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)