Skip to content

Commit 57313dc

Browse files
committed
Improve error message for bootstrap.password
1 parent 6f8cd0a commit 57313dc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

rest/config_flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func registerConfigFlags(config *StartupConfig, fs *flag.FlagSet) map[string]con
3535
"bootstrap.config_update_frequency": {config: &config.Bootstrap.ConfigUpdateFrequency, flagValue: fs.String("bootstrap.config_update_frequency", persistentConfigDefaultUpdateFrequency.String(), "How often to poll Couchbase Server for new config changes")},
3636
"bootstrap.server": {config: &config.Bootstrap.Server, flagValue: fs.String("bootstrap.server", "", "Couchbase Server connection string/URL")},
3737
"bootstrap.username": {config: &config.Bootstrap.Username, flagValue: fs.String("bootstrap.username", "", "Username for authenticating to server")},
38-
"bootstrap.password": {config: nil, disabled: true, disabledErrorMessage: "Use config file or X.509 auth instead.", flagValue: fs.String("bootstrap.password", "", "Deprecated and disabled. Do not use. Use config file or X.509 auth.")},
38+
"bootstrap.password": {config: nil, disabled: true, disabledErrorMessage: "Use config file to specify bootstrap password, or use X.509 cert/key path flags instead.", flagValue: fs.String("bootstrap.password", "", "Deprecated and disabled. Do not use. Use config file or X.509 auth.")},
3939
"bootstrap.ca_cert_path": {config: &config.Bootstrap.CACertPath, flagValue: fs.String("bootstrap.ca_cert_path", "", "Root CA cert path for TLS connection")},
4040
"bootstrap.server_tls_skip_verify": {config: &config.Bootstrap.ServerTLSSkipVerify, flagValue: fs.Bool("bootstrap.server_tls_skip_verify", false, "Allow empty server CA Cert Path without attempting to use system root pool")},
4141
"bootstrap.x509_cert_path": {config: &config.Bootstrap.X509CertPath, flagValue: fs.String("bootstrap.x509_cert_path", "", "Cert path (public key) for X.509 bucket auth")},

rest/config_flags_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ func TestDisabledFlagsErrorAndDoNotMutateConfig(t *testing.T) {
188188

189189
// All disabled flags should be mentioned in the error
190190
assert.Contains(t, err.Error(), "bootstrap.password")
191+
assert.Contains(t, err.Error(), "Use config file to specify bootstrap password")
192+
assert.Contains(t, err.Error(), "use X.509 cert/key path flags instead.")
191193

192194
// And none should have modified the config
193195
assert.Equal(t, "", config.Bootstrap.Password)

0 commit comments

Comments
 (0)