fix: Clean kafka default configuration (#30925)

issue: #30917
pr: #30924

Signed-off-by: yhmo <yihua.mo@zilliz.com>
This commit is contained in:
groot 2024-03-01 18:15:29 +08:00 committed by GitHub
parent ef84d40e54
commit 5b695d7e86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 11 deletions

View File

@ -123,8 +123,8 @@ pulsar:
# brokerList:
# saslUsername:
# saslPassword:
# saslMechanisms: PLAIN
# securityProtocol: SASL_SSL
# saslMechanisms:
# securityProtocol:
# readTimeout: 10 # read message timeout in seconds
# ssl:
# enabled: false # Whether to support kafka secure connection mode

View File

@ -688,7 +688,7 @@ func (k *KafkaConfig) Init(base *BaseTable) {
k.SaslMechanisms = ParamItem{
Key: "kafka.saslMechanisms",
DefaultValue: "PLAIN",
DefaultValue: "",
Version: "2.1.0",
Export: true,
}
@ -696,7 +696,7 @@ func (k *KafkaConfig) Init(base *BaseTable) {
k.SecurityProtocol = ParamItem{
Key: "kafka.securityProtocol",
DefaultValue: "SASL_SSL",
DefaultValue: "",
Version: "2.1.0",
Export: true,
}
@ -705,7 +705,7 @@ func (k *KafkaConfig) Init(base *BaseTable) {
k.KafkaUseSSL = ParamItem{
Key: "kafka.ssl.enabled",
DefaultValue: "false",
Version: "2.3.8",
Version: "2.3.11",
Doc: "whether to enable ssl mode",
Export: true,
}
@ -713,7 +713,7 @@ func (k *KafkaConfig) Init(base *BaseTable) {
k.KafkaTLSCert = ParamItem{
Key: "kafka.ssl.tlsCert",
Version: "2.3.8",
Version: "2.3.11",
Doc: "path to client's public key (PEM) used for authentication",
Export: true,
}
@ -721,7 +721,7 @@ func (k *KafkaConfig) Init(base *BaseTable) {
k.KafkaTLSKey = ParamItem{
Key: "kafka.ssl.tlsKey",
Version: "2.3.8",
Version: "2.3.11",
Doc: "path to client's private key (PEM) used for authentication",
Export: true,
}
@ -729,7 +729,7 @@ func (k *KafkaConfig) Init(base *BaseTable) {
k.KafkaTLSCACert = ParamItem{
Key: "kafka.ssl.tlsCaCert",
Version: "2.3.8",
Version: "2.3.11",
Doc: "file or directory path to CA certificate(s) for verifying the broker's key",
Export: true,
}
@ -737,7 +737,7 @@ func (k *KafkaConfig) Init(base *BaseTable) {
k.KafkaTLSKeyPassword = ParamItem{
Key: "kafka.ssl.tlsKeyPassword",
Version: "2.3.8",
Version: "2.3.11",
Doc: "private key passphrase for use with ssl.key.location and set_ssl_cert(), if any",
Export: true,
}

View File

@ -166,8 +166,8 @@ func TestServiceParam(t *testing.T) {
base := &BaseTable{mgr: config.NewManager()}
kc.Init(base)
assert.Empty(t, kc.Address.GetValue())
assert.Equal(t, kc.SaslMechanisms.GetValue(), "PLAIN")
assert.Equal(t, kc.SecurityProtocol.GetValue(), "SASL_SSL")
assert.Empty(t, kc.SaslMechanisms.GetValue())
assert.Empty(t, kc.SecurityProtocol.GetValue())
assert.Equal(t, kc.ReadTimeout.GetAsDuration(time.Second), 10*time.Second)
assert.Equal(t, kc.KafkaUseSSL.GetAsBool(), false)
assert.Empty(t, kc.KafkaTLSCACert.GetValue())