Skip to content

Commit 49c8fa0

Browse files
committed
Fix panic on AccessLogPolicy targetRef namespace mismatch
Fixes #626
1 parent f5ff454 commit 49c8fa0

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)