Skip to content

Commit

Permalink
revise according to review opinion
Browse files Browse the repository at this point in the history
  • Loading branch information
ctccxxd committed Nov 24, 2024
1 parent d26e32c commit e2bcd3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apis/keda/v1alpha1/scaledobject_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (so *ScaledObject) CheckScaleTargetRefIfExist(ctx context.Context) error {
gvkString := soGvkr.GVKString()
unstruct := &unstructured.Unstructured{}
unstruct.SetGroupVersionKind(soGvkr.GroupVersionKind())
if err := kc.Get(ctx, client.ObjectKey{Namespace: so.Namespace, Name: so.Spec.ScaleTargetRef.Name}, unstruct); err != nil {
if err := getFromCacheOrDirect(ctx, client.ObjectKey{Namespace: so.Namespace, Name: so.Spec.ScaleTargetRef.Name}, unstruct); err != nil {
// resource doesn't exist
scaledobjectlog.Error(err, message.ScaleTargetNotFoundMsg, "resource", gvkString, "name", so.Spec.ScaleTargetRef.Name)
return err
Expand Down

0 comments on commit e2bcd3f

Please sign in to comment.