From c90cab8567ce8040c351615f3d69f9df60c574a1 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Wed, 24 Jan 2024 13:08:44 +1100 Subject: [PATCH] refactor: remove resources after theyve completed reconciling --- controllers/v1beta1/build_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/v1beta1/build_controller.go b/controllers/v1beta1/build_controller.go index 62d84355..076fa15b 100644 --- a/controllers/v1beta1/build_controller.go +++ b/controllers/v1beta1/build_controller.go @@ -177,8 +177,8 @@ func (r *LagoonBuildReconciler) Reconcile(ctx context.Context, req ctrl.Request) // with the introduction of v1beta2, this will let any existing pending/qeued/running builds continue through // but once the build is completed or failed and has processed anything else it needs to do, it should delete the resource if _, ok := lagoonBuild.Labels["lagoon.sh/buildStatus"]; ok { - if !helpers.ContainsString( - lagoonv1beta1.BuildRunningPendingStatus, + if helpers.ContainsString( + lagoonv1beta1.BuildCompletedCancelledFailedStatus, lagoonBuild.Labels["lagoon.sh/buildStatus"], ) { opLog.Info(fmt.Sprintf("%s found in namespace %s is no longer required, removing it. v1beta1 is deprecated in favor of v1beta2",