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 == "" { if trigger.Name == "" {
trigger.Name = fmt.Sprintf("trigger-%s-%d", trigger.Type, idx+1) trigger.Name = fmt.Sprintf("trigger-%s-%d", trigger.Type, idx+1)
} }
autoscalingTrigger := ProcessAutoscalingTrigger{
Name: trigger.Name, Name: trigger.Name,
Type: trigger.Type, Type: trigger.Type,
Metadata: metadata, Metadata: metadata,
} }
if auth, ok := input.KedaValues.Authentications[trigger.Type]; ok { if auth, ok := input.KedaValues.Authentications[trigger.Type]; ok {
trigger.AuthenticationRef = &ProcessAutoscalingTriggerAuthenticationRef{ autoscalingTrigger.AuthenticationRef = &ProcessAutoscalingTriggerAuthenticationRef{
Name: auth.Name, Name: auth.Name,
Kind: string(auth.Kind), Kind: string(auth.Kind),
} }
} else if auth, ok := input.KedaValues.GlobalAuthentications[trigger.Type]; ok { } else if auth, ok := input.KedaValues.GlobalAuthentications[trigger.Type]; ok {
trigger.AuthenticationRef = &ProcessAutoscalingTriggerAuthenticationRef{ autoscalingTrigger.AuthenticationRef = &ProcessAutoscalingTriggerAuthenticationRef{
Name: auth.Name, Name: auth.Name,
Kind: string(auth.Kind), Kind: string(auth.Kind),
} }
} }
triggers = append(triggers, trigger) triggers = append(triggers, autoscalingTrigger)
} }
autoscaling := ProcessAutoscaling{ autoscaling := ProcessAutoscaling{