Skip to content

Separate the keda's trigger configuration from scaleOptions#232

Merged
benjaminhuo merged 1 commit intoOpenFunction:mainfrom
tpiperatgod:dev
Feb 10, 2022
Merged

Separate the keda's trigger configuration from scaleOptions#232
benjaminhuo merged 1 commit intoOpenFunction:mainfrom
tpiperatgod:dev

Conversation

@tpiperatgod
Copy link
Copy Markdown
Member

for issue #184

Signed-off-by: laminar [email protected]

@tpiperatgod tpiperatgod linked an issue Feb 10, 2022 that may be closed by this pull request
bootstrapServers: kafka-server-kafka-brokers.default.svc.cluster.local:9092
consumerGroup: autoscaling-subscriber
lagThreshold: "10"
targetKind: "object"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add a default value for targetKind?
default to object if not set in the yaml?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the default value, like this:

scaledJobTriggers := []kedav1alpha1.ScaleTriggers{}
scaledObjectTriggers := []kedav1alpha1.ScaleTriggers{}
for _, triggers := range s.Spec.Triggers {
t := triggers.DeepCopy()
if t.TargetKind != nil && *t.TargetKind == openfunction.ScaledJob {
scaledJobTriggers = append(scaledJobTriggers, t.ScaleTriggers)
} else {
scaledObjectTriggers = append(scaledObjectTriggers, t.ScaleTriggers)
}
}

@benjaminhuo benjaminhuo merged commit 7cd8bc3 into OpenFunction:main Feb 10, 2022
@tpiperatgod tpiperatgod deleted the dev branch February 10, 2022 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactoring OpenFuncAsync runtime definition

2 participants