Skip to content

Commit 4a816e5

Browse files
j-vizcainoRyan Lymburner
andauthored
Fix panic on AccessLogPolicy targetRef namespace mismatch (#739)
Fixes #626 Co-authored-by: Ryan Lymburner <137918933+rlymbur@users.noreply.github.com>
1 parent 3f8359f commit 4a816e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/controllers/accesslogpolicy_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (r *accessLogPolicyReconciler) reconcileUpsert(ctx context.Context, alp *an
182182
targetRefNamespace := k8s.NamespaceOrDefault(alp.Spec.TargetRef.Namespace)
183183
if targetRefNamespace != alp.Namespace {
184184
message := fmt.Sprintf("The targetRef's namespace, \"%s\", does not match the Access Log Policy's"+
185-
" namespace, \"%s\"", string(*alp.Spec.TargetRef.Namespace), alp.Namespace)
185+
" namespace, \"%s\"", targetRefNamespace, alp.Namespace)
186186
r.eventRecorder.Event(alp, corev1.EventTypeWarning, k8s.FailedReconcileEvent, message)
187187
return r.updateAccessLogPolicyStatus(ctx, alp, gwv1alpha2.PolicyReasonInvalid, message)
188188
}

0 commit comments

Comments
 (0)