Fission MQT integration with keda (#1657)

Fission MQT integration based on Keda with Kafka connector
This commit is contained in:
Rahul Bhati
2020-07-14 21:35:48 +05:30
committed by GitHub
parent d6fc9f71d0
commit 8e0571c7c9
25 changed files with 2203 additions and 28 deletions
+35
View File
@@ -93,6 +93,34 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
return err
}
pollingInterval := int32(input.Int(flagkey.MqtPollingInterval))
if pollingInterval < 0 {
return errors.New("Polling interval must be greater than or equal to 0")
}
cooldownPeriod := int32(input.Int(flagkey.MqtCooldownPeriod))
if cooldownPeriod < 0 {
return errors.New("CooldownPeriod interval is the period to wait after the last trigger reported active before scaling the deployment back to 0, it must be greater than or equal to 0")
}
minReplicaCount := int32(input.Int(flagkey.MqtMinReplicaCount))
if minReplicaCount < 0 {
return errors.New("MinReplicaCount must be greater than or equal to 0")
}
maxReplicaCount := int32(input.Int(flagkey.MqtMaxReplicaCount))
if maxReplicaCount < 0 {
return errors.New("MaxReplicaCount must be greater than or equal to 0")
}
metadata := make(map[string]string)
metadataParams := input.StringSlice(flagkey.MqtMetadata)
_ = util.UpdateMapFromStringSlice(&metadata, metadataParams)
secret := input.String(flagkey.MqtSecret)
mqtKind := input.String(flagkey.MqtKind)
if input.Bool(flagkey.SpecSave) {
specDir := util.GetSpecDir(input)
fr, err := spec.ReadSpecs(specDir)
@@ -131,6 +159,13 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
ErrorTopic: errorTopic,
MaxRetries: maxRetries,
ContentType: contentType,
PollingInterval: &pollingInterval,
CooldownPeriod: &cooldownPeriod,
MinReplicaCount: &minReplicaCount,
MaxReplicaCount: &maxReplicaCount,
Metadata: metadata,
Secret: secret,
MqtKind: mqtKind,
},
}