Skip to content

Commit

Permalink
check nil for spec.advanced.horizontalPodAutoscalerConfig
Browse files Browse the repository at this point in the history
Signed-off-by: wangrushen <[email protected]>
  • Loading branch information
dovics committed Oct 22, 2024
1 parent de0f603 commit 4a7cb03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apis/keda/v1alpha1/scaledobject_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ func isContainerResourceLimitSet(ctx context.Context, namespace string, triggerT
}

func getHpaName(so ScaledObject) string {
if so.Spec.Advanced == nil || so.Spec.Advanced.HorizontalPodAutoscalerConfig.Name == "" {
if so.Spec.Advanced == nil || so.Spec.Advanced.HorizontalPodAutoscalerConfig == nil || so.Spec.Advanced.HorizontalPodAutoscalerConfig.Name == "" {
return fmt.Sprintf("keda-hpa-%s", so.Name)
}

Expand Down

0 comments on commit 4a7cb03

Please sign in to comment.