fix: do not shadow the trigger variable

This commit is contained in:
Jose Diaz-Gonzalez
2024-11-13 02:15:18 -05:00
parent 62f25ad33f
commit 7e406436fa

View File

@@ -606,24 +606,26 @@ func getAutoscaling(input GetAutoscalingInput) (ProcessAutoscaling, error) {
if trigger.Name == "" {
trigger.Name = fmt.Sprintf("trigger-%s-%d", trigger.Type, idx+1)
}
autoscalingTrigger := ProcessAutoscalingTrigger{
Name: trigger.Name,
Type: trigger.Type,
Metadata: metadata,
}
if auth, ok := input.KedaValues.Authentications[trigger.Type]; ok {
trigger.AuthenticationRef = &ProcessAutoscalingTriggerAuthenticationRef{
autoscalingTrigger.AuthenticationRef = &ProcessAutoscalingTriggerAuthenticationRef{
Name: auth.Name,
Kind: string(auth.Kind),
}
} else if auth, ok := input.KedaValues.GlobalAuthentications[trigger.Type]; ok {
trigger.AuthenticationRef = &ProcessAutoscalingTriggerAuthenticationRef{
autoscalingTrigger.AuthenticationRef = &ProcessAutoscalingTriggerAuthenticationRef{
Name: auth.Name,
Kind: string(auth.Kind),
}
}
triggers = append(triggers, trigger)
triggers = append(triggers, autoscalingTrigger)
}
autoscaling := ProcessAutoscaling{