From 9fce5627b36364417f216ad6ea57ee9a17e3b782 Mon Sep 17 00:00:00 2001 From: Sebastian Florek Date: Fri, 17 Jan 2025 19:53:45 +0100 Subject: [PATCH] fix: project controller trying to delete readonly project (#1764) --- go/controller/internal/controller/project_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/controller/internal/controller/project_controller.go b/go/controller/internal/controller/project_controller.go index c0e0fb15a2..06d0afdb9e 100644 --- a/go/controller/internal/controller/project_controller.go +++ b/go/controller/internal/controller/project_controller.go @@ -141,8 +141,8 @@ func (in *ProjectReconciler) addOrRemoveFinalizer(ctx context.Context, project * return &requeue } - // Remove Pipeline from Console API if it exists. - if exists { + // Remove project from Console API if it exists and is not readonly + if exists && !project.Status.IsReadonly() { if err := in.ConsoleClient.DeleteProject(ctx, project.Status.GetID()); err != nil { // If it fails to delete the external dependency here, return with error // so that it can be retried.