Added validation to keda types and updated help (#2346)
* Added validation to keda types and updated help * Changed formatting of help * Changed variable name
This commit is contained in:
@@ -21,8 +21,17 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
topicValidators = make(map[string]TopicValidator)
|
||||
lock = sync.Mutex{}
|
||||
topicValidators = make(map[string]TopicValidator)
|
||||
lock = sync.Mutex{}
|
||||
kedaMqTypeValidators = map[string]bool{
|
||||
"kafka": true,
|
||||
"aws-sqs-queue": true,
|
||||
"aws-kinesis-stream": true,
|
||||
"gcp-pubsub": true,
|
||||
"stan": true,
|
||||
"rabbitmq": true,
|
||||
"redis": true,
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -58,7 +67,7 @@ func IsValidTopic(mqType, topic, mqtKind string) bool {
|
||||
|
||||
func IsValidMessageQueue(mqType, mqtKind string) bool {
|
||||
if mqtKind == "keda" {
|
||||
return true
|
||||
return kedaMqTypeValidators[mqType]
|
||||
}
|
||||
_, registered := topicValidators[mqType]
|
||||
return registered
|
||||
|
||||
Reference in New Issue
Block a user