From 49c8fa09c06981e335789a26cf375dfc8810ea7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vizcaino?= Date: Wed, 21 May 2025 15:45:06 +0200 Subject: [PATCH] Fix panic on AccessLogPolicy targetRef namespace mismatch Fixes #626 --- pkg/controllers/accesslogpolicy_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controllers/accesslogpolicy_controller.go b/pkg/controllers/accesslogpolicy_controller.go index 6288ba94..5c033d80 100644 --- a/pkg/controllers/accesslogpolicy_controller.go +++ b/pkg/controllers/accesslogpolicy_controller.go @@ -182,7 +182,7 @@ func (r *accessLogPolicyReconciler) reconcileUpsert(ctx context.Context, alp *an targetRefNamespace := k8s.NamespaceOrDefault(alp.Spec.TargetRef.Namespace) if targetRefNamespace != alp.Namespace { message := fmt.Sprintf("The targetRef's namespace, \"%s\", does not match the Access Log Policy's"+ - " namespace, \"%s\"", string(*alp.Spec.TargetRef.Namespace), alp.Namespace) + " namespace, \"%s\"", targetRefNamespace, alp.Namespace) r.eventRecorder.Event(alp, corev1.EventTypeWarning, k8s.FailedReconcileEvent, message) return r.updateAccessLogPolicyStatus(ctx, alp, gwv1alpha2.PolicyReasonInvalid, message) }