mirror of
https://github.com/minio/minio.git
synced 2025-04-23 03:45:49 -04:00
remove double ENABLED help output (#16528)
This commit is contained in:
parent
8ca14e6267
commit
aa8b9572b9
@ -701,37 +701,42 @@ func GetHelp(subSys, key string, envOnly bool) (Help, error) {
|
|||||||
h = config.HelpKVS{value}
|
h = config.HelpKVS{value}
|
||||||
}
|
}
|
||||||
|
|
||||||
envHelp := config.HelpKVS{}
|
help := config.HelpKVS{}
|
||||||
if envOnly {
|
|
||||||
// Only for multiple targets, make sure
|
// Only for multiple targets, make sure
|
||||||
// to list the ENV, for regular k/v EnableKey is
|
// to list the ENV, for regular k/v EnableKey is
|
||||||
// implicit, for ENVs we cannot make it implicit.
|
// implicit, for ENVs we cannot make it implicit.
|
||||||
if subSysHelp.MultipleTargets {
|
if subSysHelp.MultipleTargets {
|
||||||
envK := config.EnvPrefix + strings.ToTitle(subSys) + config.EnvWordDelimiter + strings.ToTitle(madmin.EnableKey)
|
key := madmin.EnableKey
|
||||||
envHelp = append(envHelp, config.HelpKV{
|
if envOnly {
|
||||||
Key: envK,
|
key = config.EnvPrefix + strings.ToTitle(subSys) + config.EnvWordDelimiter + strings.ToTitle(madmin.EnableKey)
|
||||||
Description: fmt.Sprintf("enable %s target, default is 'off'", subSys),
|
|
||||||
Optional: false,
|
|
||||||
Type: "on|off",
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
for _, hkv := range h {
|
help = append(help, config.HelpKV{
|
||||||
envK := config.EnvPrefix + strings.ToTitle(subSys) + config.EnvWordDelimiter + strings.ToTitle(hkv.Key)
|
Key: key,
|
||||||
envHelp = append(envHelp, config.HelpKV{
|
Description: fmt.Sprintf("enable %s target, default is 'off'", subSys),
|
||||||
Key: envK,
|
Optional: false,
|
||||||
Description: hkv.Description,
|
Type: "on|off",
|
||||||
Optional: hkv.Optional,
|
})
|
||||||
Type: hkv.Type,
|
}
|
||||||
})
|
|
||||||
|
for _, hkv := range h {
|
||||||
|
key := hkv.Key
|
||||||
|
if envOnly {
|
||||||
|
key = config.EnvPrefix + strings.ToTitle(subSys) + config.EnvWordDelimiter + strings.ToTitle(hkv.Key)
|
||||||
}
|
}
|
||||||
h = envHelp
|
help = append(help, config.HelpKV{
|
||||||
|
Key: key,
|
||||||
|
Description: hkv.Description,
|
||||||
|
Optional: hkv.Optional,
|
||||||
|
Type: hkv.Type,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return Help{
|
return Help{
|
||||||
SubSys: subSys,
|
SubSys: subSys,
|
||||||
Description: subSysHelp.Description,
|
Description: subSysHelp.Description,
|
||||||
MultipleTargets: subSysHelp.MultipleTargets,
|
MultipleTargets: subSysHelp.MultipleTargets,
|
||||||
KeysHelp: h,
|
KeysHelp: help,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,13 +26,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Help = config.HelpKVS{
|
Help = config.HelpKVS{
|
||||||
config.HelpKV{
|
|
||||||
Key: config.Enable,
|
|
||||||
Description: "Enable or disable OpenID",
|
|
||||||
Type: "on|off",
|
|
||||||
Optional: true,
|
|
||||||
Sensitive: false,
|
|
||||||
},
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: DisplayName,
|
Key: DisplayName,
|
||||||
Description: "Friendly display name for this Provider/App" + defaultHelpPostfix(DisplayName),
|
Description: "Friendly display name for this Provider/App" + defaultHelpPostfix(DisplayName),
|
||||||
|
@ -28,18 +28,9 @@ const (
|
|||||||
queueLimitComment = `maximum limit for undelivered messages, defaults to '100000'`
|
queueLimitComment = `maximum limit for undelivered messages, defaults to '100000'`
|
||||||
)
|
)
|
||||||
|
|
||||||
var enableHelp = config.HelpKV{
|
|
||||||
Key: config.Enable,
|
|
||||||
Description: "Enable or disable notifications",
|
|
||||||
Type: "on|off",
|
|
||||||
Sensitive: false,
|
|
||||||
Optional: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Help template inputs for all notification targets
|
// Help template inputs for all notification targets
|
||||||
var (
|
var (
|
||||||
HelpWebhook = config.HelpKVS{
|
HelpWebhook = config.HelpKVS{
|
||||||
enableHelp,
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: target.WebhookEndpoint,
|
Key: target.WebhookEndpoint,
|
||||||
Description: "webhook server endpoint e.g. http://localhost:8080/minio/events",
|
Description: "webhook server endpoint e.g. http://localhost:8080/minio/events",
|
||||||
@ -88,7 +79,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpAMQP = config.HelpKVS{
|
HelpAMQP = config.HelpKVS{
|
||||||
enableHelp,
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: target.AmqpURL,
|
Key: target.AmqpURL,
|
||||||
Description: "AMQP server endpoint e.g. `amqp://myuser:mypassword@localhost:5672`",
|
Description: "AMQP server endpoint e.g. `amqp://myuser:mypassword@localhost:5672`",
|
||||||
@ -177,7 +167,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpKafka = config.HelpKVS{
|
HelpKafka = config.HelpKVS{
|
||||||
enableHelp,
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: target.KafkaBrokers,
|
Key: target.KafkaBrokers,
|
||||||
Description: "comma separated list of Kafka broker addresses",
|
Description: "comma separated list of Kafka broker addresses",
|
||||||
@ -274,7 +263,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpMQTT = config.HelpKVS{
|
HelpMQTT = config.HelpKVS{
|
||||||
enableHelp,
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: target.MqttBroker,
|
Key: target.MqttBroker,
|
||||||
Description: "MQTT server endpoint e.g. `tcp://localhost:1883`",
|
Description: "MQTT server endpoint e.g. `tcp://localhost:1883`",
|
||||||
@ -339,7 +327,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpPostgres = config.HelpKVS{
|
HelpPostgres = config.HelpKVS{
|
||||||
enableHelp,
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: target.PostgresConnectionString,
|
Key: target.PostgresConnectionString,
|
||||||
Description: `Postgres server connection-string e.g. "host=localhost port=5432 dbname=minio_events user=postgres password=password sslmode=disable"`,
|
Description: `Postgres server connection-string e.g. "host=localhost port=5432 dbname=minio_events user=postgres password=password sslmode=disable"`,
|
||||||
@ -383,7 +370,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpMySQL = config.HelpKVS{
|
HelpMySQL = config.HelpKVS{
|
||||||
enableHelp,
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: target.MySQLDSNString,
|
Key: target.MySQLDSNString,
|
||||||
Description: `MySQL data-source-name connection string e.g. "<user>:<password>@tcp(<host>:<port>)/<database>"`,
|
Description: `MySQL data-source-name connection string e.g. "<user>:<password>@tcp(<host>:<port>)/<database>"`,
|
||||||
@ -428,7 +414,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpNATS = config.HelpKVS{
|
HelpNATS = config.HelpKVS{
|
||||||
enableHelp,
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: target.NATSAddress,
|
Key: target.NATSAddress,
|
||||||
Description: "NATS server address e.g. '0.0.0.0:4222'",
|
Description: "NATS server address e.g. '0.0.0.0:4222'",
|
||||||
@ -551,7 +536,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpNSQ = config.HelpKVS{
|
HelpNSQ = config.HelpKVS{
|
||||||
enableHelp,
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: target.NSQAddress,
|
Key: target.NSQAddress,
|
||||||
Description: "NSQ server address e.g. '127.0.0.1:4150'",
|
Description: "NSQ server address e.g. '127.0.0.1:4150'",
|
||||||
@ -596,7 +580,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpES = config.HelpKVS{
|
HelpES = config.HelpKVS{
|
||||||
enableHelp,
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: target.ElasticURL,
|
Key: target.ElasticURL,
|
||||||
Description: "Elasticsearch server's address, with optional authentication info",
|
Description: "Elasticsearch server's address, with optional authentication info",
|
||||||
@ -648,7 +631,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpRedis = config.HelpKVS{
|
HelpRedis = config.HelpKVS{
|
||||||
enableHelp,
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: target.RedisAddress,
|
Key: target.RedisAddress,
|
||||||
Description: "Redis server's address. For example: `localhost:6379`",
|
Description: "Redis server's address. For example: `localhost:6379`",
|
||||||
|
@ -24,13 +24,6 @@ import (
|
|||||||
// Help template for logger http and audit
|
// Help template for logger http and audit
|
||||||
var (
|
var (
|
||||||
Help = config.HelpKVS{
|
Help = config.HelpKVS{
|
||||||
config.HelpKV{
|
|
||||||
Key: config.Enable,
|
|
||||||
Description: "set to 'on' to enable the logger webhook",
|
|
||||||
Optional: true,
|
|
||||||
Type: "on|off",
|
|
||||||
Sensitive: false,
|
|
||||||
},
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: Endpoint,
|
Key: Endpoint,
|
||||||
Description: `HTTP(s) endpoint e.g. "http://localhost:8080/minio/logs/server"`,
|
Description: `HTTP(s) endpoint e.g. "http://localhost:8080/minio/logs/server"`,
|
||||||
@ -73,13 +66,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpWebhook = config.HelpKVS{
|
HelpWebhook = config.HelpKVS{
|
||||||
config.HelpKV{
|
|
||||||
Key: config.Enable,
|
|
||||||
Description: "set to 'on' to enable the audit logger",
|
|
||||||
Optional: true,
|
|
||||||
Type: "on|off",
|
|
||||||
Sensitive: false,
|
|
||||||
},
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: Endpoint,
|
Key: Endpoint,
|
||||||
Description: `HTTP(s) endpoint e.g. "http://localhost:8080/minio/logs/audit"`,
|
Description: `HTTP(s) endpoint e.g. "http://localhost:8080/minio/logs/audit"`,
|
||||||
@ -122,13 +108,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
HelpKafka = config.HelpKVS{
|
HelpKafka = config.HelpKVS{
|
||||||
config.HelpKV{
|
|
||||||
Key: config.Enable,
|
|
||||||
Description: "set to 'on' to enable kafka audit logging",
|
|
||||||
Optional: true,
|
|
||||||
Type: "on|off",
|
|
||||||
Sensitive: false,
|
|
||||||
},
|
|
||||||
config.HelpKV{
|
config.HelpKV{
|
||||||
Key: KafkaBrokers,
|
Key: KafkaBrokers,
|
||||||
Description: "comma separated list of Kafka broker addresses",
|
Description: "comma separated list of Kafka broker addresses",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user