From d4bb1b08a3d34486af2066c57fd6723dacf49a7f Mon Sep 17 00:00:00 2001 From: Somtochi Onyekwere Date: Thu, 27 Jan 2022 21:20:08 +0100 Subject: [PATCH] use correct git repo namespace Signed-off-by: Somtochi Onyekwere --- controllers/imageupdateautomation_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/imageupdateautomation_controller.go b/controllers/imageupdateautomation_controller.go index 56e8c7bc..44cbb46b 100644 --- a/controllers/imageupdateautomation_controller.go +++ b/controllers/imageupdateautomation_controller.go @@ -181,7 +181,7 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr } debuglog.Info("fetching git repository", "gitrepository", originName) - if r.NoCrossNamespaceRef && auto.Spec.SourceRef.Namespace != auto.GetNamespace() { + if r.NoCrossNamespaceRef && gitRepoNamespace != auto.GetNamespace() { err := acl.AccessDeniedError(fmt.Sprintf("can't access '%s/%s', cross-namespace references have been blocked", auto.Spec.SourceRef.Kind, originName)) log.Error(err, "access denied to cross-namespaced resource")