ensure keys are not empty
This commit is contained in:
+3
-3
@@ -262,11 +262,11 @@ func createKeyProvider(conf *config.Config) (auth.KeyProvider, error) {
|
|||||||
return auth.NewFileBasedKeyProviderFromReader(f)
|
return auth.NewFileBasedKeyProviderFromReader(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
if conf.Keys != nil {
|
if len(conf.Keys) == 0 {
|
||||||
return auth.NewFileBasedKeyProviderFromMap(conf.Keys), nil
|
return nil, errors.New("one of key-file or keys must be provided in order to support a secure installation")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, errors.New("one of key-file or keys must be provided in order to support a secure installation")
|
return auth.NewFileBasedKeyProviderFromMap(conf.Keys), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getConfigString(c *cli.Context) (string, error) {
|
func getConfigString(c *cli.Context) (string, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user