From 1a9acbb3d71ac797dae14bbb32533507b30538e4 Mon Sep 17 00:00:00 2001 From: Greg Haynes Date: Tue, 17 Oct 2023 14:19:44 -0700 Subject: [PATCH] Dont try to create argo apps when embedded argo apps disabled (#35) * Dont try to create argo apps when embedded argo apps disabled * Shutdown after no-op of creating argo apps if embedded apps disabled --- pkg/controllers/localbuild/controller.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/controllers/localbuild/controller.go b/pkg/controllers/localbuild/controller.go index e419d93e..a9847241 100644 --- a/pkg/controllers/localbuild/controller.go +++ b/pkg/controllers/localbuild/controller.go @@ -172,6 +172,13 @@ func (r *LocalbuildReconciler) ReconcileEmbeddedGitServer(ctx context.Context, r func (r *LocalbuildReconciler) ReconcileArgoApps(ctx context.Context, req ctrl.Request, resource *v1alpha1.Localbuild) (ctrl.Result, error) { log := log.FromContext(ctx) + // Bail if embedded argo applications not enabled + if !resource.Spec.PackageConfigs.EmbeddedArgoApplications.Enabled { + log.Info("embedded argo applications disabled, not installing embedded git server") + r.shouldShutdown = true + return ctrl.Result{}, nil + } + // Create argo project // DeepEqual is broken on argo resources for some reason so we have to DIY create/update project := &argov1alpha1.AppProject{