Skip to content

Commit

Permalink
change the sv to so
Browse files Browse the repository at this point in the history
Signed-off-by: Shane <[email protected]>
  • Loading branch information
ctccxxd committed Dec 16, 2024
1 parent 1fc9e5a commit f56c05b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apis/keda/v1alpha1/scaledobject_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ func verifyHpas(incomingSo *ScaledObject, action string, _ bool) error {
return err
}

var incomingSvGvkr GroupVersionKindResource
incomingSvGvkr, err = ParseGVKR(restMapper, incomingSo.Spec.ScaleTargetRef.APIVersion, incomingSo.Spec.ScaleTargetRef.Kind)
var incomingSoGvkr GroupVersionKindResource
incomingSoGvkr, err = ParseGVKR(restMapper, incomingSo.Spec.ScaleTargetRef.APIVersion, incomingSo.Spec.ScaleTargetRef.Kind)
if err != nil {
scaledobjectlog.Error(err, "Failed to parse Group, Version, Kind, Resource from incoming ScaledObject", "apiVersion", incomingSo.Spec.ScaleTargetRef.APIVersion, "kind", incomingSo.Spec.ScaleTargetRef.Kind)
return err
Expand All @@ -251,7 +251,7 @@ func verifyHpas(incomingSo *ScaledObject, action string, _ bool) error {
return err
}

if hpaGvkr.GVKString() == incomingSvGvkr.GVKString() &&
if hpaGvkr.GVKString() == incomingSoGvkr.GVKString() &&
hpa.Spec.ScaleTargetRef.Name == incomingSo.Spec.ScaleTargetRef.Name {
owned := false
for _, owner := range hpa.OwnerReferences {
Expand All @@ -268,7 +268,7 @@ func verifyHpas(incomingSo *ScaledObject, action string, _ bool) error {
incomingSo.Spec.Advanced.HorizontalPodAutoscalerConfig.Name == hpa.Name {
scaledobjectlog.Info(fmt.Sprintf("%s hpa ownership being transferred to %s", hpa.Name, incomingSo.Name))
} else {
err = fmt.Errorf("the workload '%s' of type '%s' is already managed by the hpa '%s'", incomingSo.Spec.ScaleTargetRef.Name, incomingSvGvkr.GVKString(), hpa.Name)
err = fmt.Errorf("the workload '%s' of type '%s' is already managed by the hpa '%s'", incomingSo.Spec.ScaleTargetRef.Name, incomingSoGvkr.GVKString(), hpa.Name)
scaledobjectlog.Error(err, "validation error")
metricscollector.RecordScaledObjectValidatingErrors(incomingSo.Namespace, action, "other-hpa")
return err
Expand Down

0 comments on commit f56c05b

Please sign in to comment.