0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

fix(config): better configuration errors using viper.UnmarshalExact() (#2050)

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
peusebiu 2023-11-16 19:00:55 +02:00 committed by GitHub
parent bdf6d23863
commit 60eaf7b5d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -718,7 +718,7 @@ func LoadConfiguration(config *config.Config, configPath string) error {
}
metaData := &mapstructure.Metadata{}
if err := viperInstance.Unmarshal(&config, metadataConfig(metaData)); err != nil {
if err := viperInstance.UnmarshalExact(&config, metadataConfig(metaData)); err != nil {
log.Error().Err(err).Msg("error while unmarshaling new config")
return err