mirror of
https://github.com/minio/minio.git
synced 2025-11-25 20:16:10 -05:00
config: Check for duplicated entries in all scopes (#3872)
Validate Minio config by checking if there is double json key in any scope level. The returned error contains the json path to the duplicated key.
This commit is contained in:
committed by
Harshavardhana
parent
cad0d0eb7a
commit
ae4361cc45
@@ -17,6 +17,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
||||
@@ -39,6 +40,16 @@ type kafkaNotify struct {
|
||||
Topic string `json:"topic"`
|
||||
}
|
||||
|
||||
func (k *kafkaNotify) Validate() error {
|
||||
if !k.Enable {
|
||||
return nil
|
||||
}
|
||||
if len(k.Brokers) == 0 {
|
||||
return errors.New("No broker specified")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// kafkaConn contains the active connection to the Kafka cluster and
|
||||
// the topic to send event notifications to.
|
||||
type kafkaConn struct {
|
||||
|
||||
Reference in New Issue
Block a user