mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon/config: Reload(): normalize labels before validation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
1f8d44babf
commit
b819480899
1 changed files with 4 additions and 4 deletions
|
@ -343,10 +343,6 @@ func Reload(configFile string, flags *pflag.FlagSet, reload func(*Config)) error
|
|||
newConfig = New()
|
||||
}
|
||||
|
||||
if err := Validate(newConfig); err != nil {
|
||||
return errors.Wrap(err, "file configuration validation failed")
|
||||
}
|
||||
|
||||
// Check if duplicate label-keys with different values are found
|
||||
newLabels, err := GetConflictFreeLabels(newConfig.Labels)
|
||||
if err != nil {
|
||||
|
@ -354,6 +350,10 @@ func Reload(configFile string, flags *pflag.FlagSet, reload func(*Config)) error
|
|||
}
|
||||
newConfig.Labels = newLabels
|
||||
|
||||
if err := Validate(newConfig); err != nil {
|
||||
return errors.Wrap(err, "file configuration validation failed")
|
||||
}
|
||||
|
||||
reload(newConfig)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue