Skip to content

Commit

Permalink
chore: explictly return values
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Jun 17, 2024
1 parent 10d824d commit f00b850
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controller/gateway/controller_reconciler_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ func getSupportedKindsWithResolvedRefsCondition(ctx context.Context, c client.Cl
referenceGrantList := &gatewayv1beta1.ReferenceGrantList{}
err = c.List(ctx, referenceGrantList, client.InNamespace(secretNamespace))
if err != nil {
return
return nil, metav1.Condition{}, fmt.Errorf("failed to list ReferenceGrants: %w", err)
}
if !isSecretCrossReferenceGranted(gatewayv1.Namespace(gatewayNamespace), certificateRef.Name, referenceGrantList.Items) {
resolvedRefsCondition.Reason = string(gatewayv1.ListenerReasonRefNotPermitted)
Expand All @@ -901,7 +901,7 @@ func getSupportedKindsWithResolvedRefsCondition(ctx context.Context, c client.Cl
}, certificateSecret)
if err != nil {
if !k8serrors.IsNotFound(err) {
return
return nil, metav1.Condition{}, fmt.Errorf("failed to get Secret: %w", err)
}
resolvedRefsCondition.Reason = string(gatewayv1.ListenerReasonInvalidCertificateRef)
message = conditionMessage(message, fmt.Sprintf("Referenced secret %s/%s does not exist", secretNamespace, certificateRef.Name))
Expand Down

0 comments on commit f00b850

Please sign in to comment.