Skip to content

Commit

Permalink
accept 'disable' as a valid tls value for kafka scaler (#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunniwho authored Feb 14, 2022
1 parent 85dd397 commit 5898347
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
### Improvements

- **Azure Queue:** Don't call Azure queue GetProperties API unnecessarily ([#2613](https://github.com/kedacore/keda/pull/2613))
- **Kafka Scaler** Make "disable" a valid value for tls auth parameter ([#2608](https://github.com/kedacore/keda/issues/2608))

### Breaking Changes

Expand Down
2 changes: 1 addition & 1 deletion pkg/scalers/kafka_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func parseKafkaMetadata(config *ScalerConfig) (kafkaMetadata, error) {
meta.cert = config.AuthParams["cert"]
meta.key = config.AuthParams["key"]
meta.enableTLS = true
} else {
} else if val != "disable" {
return meta, fmt.Errorf("err incorrect value for TLS given: %s", val)
}
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/scalers/kafka_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ var parseKafkaAuthParamsTestDataset = []parseKafkaAuthParamsTestData{
{map[string]string{"tls": "enable", "ca": "caaa"}, false, true},
// success, SASL + TLS
{map[string]string{"sasl": "plaintext", "username": "admin", "password": "admin", "tls": "enable", "ca": "caaa", "cert": "ceert", "key": "keey"}, false, true},
// success, SASL + TLS explicitly disabled
{map[string]string{"sasl": "plaintext", "username": "admin", "password": "admin", "tls": "disable"}, false, false},
// failure, SASL incorrect type
{map[string]string{"sasl": "foo", "username": "admin", "password": "admin"}, true, false},
// failure, SASL missing username
Expand Down

0 comments on commit 5898347

Please sign in to comment.