From a75f804c91c46d1afe7f7ebdfe91e90702b258b5 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Wed, 22 May 2024 16:36:44 +0100 Subject: [PATCH] do not require approval to create stack run jobs (#193) --- pkg/controller/stacks/reconciler.go | 5 ----- pkg/controller/stacks/reconciler_test.go | 13 ------------- 2 files changed, 18 deletions(-) diff --git a/pkg/controller/stacks/reconciler.go b/pkg/controller/stacks/reconciler.go index d8c13529..f03605b7 100644 --- a/pkg/controller/stacks/reconciler.go +++ b/pkg/controller/stacks/reconciler.go @@ -108,11 +108,6 @@ func (r *StackReconciler) Reconcile(ctx context.Context, id string) (reconcile.R return reconcile.Result{}, err } - // If approval is required but not done yet, exit. - if stackRun.Approval != nil && *stackRun.Approval && stackRun.ApprovedAt == nil { - return reconcile.Result{}, nil - } - _, err = r.reconcileRunJob(ctx, stackRun) return reconcile.Result{}, err } diff --git a/pkg/controller/stacks/reconciler_test.go b/pkg/controller/stacks/reconciler_test.go index 581e8782..84877cb1 100644 --- a/pkg/controller/stacks/reconciler_test.go +++ b/pkg/controller/stacks/reconciler_test.go @@ -91,19 +91,6 @@ var _ = Describe("Reconciler", Ordered, func() { Expect(err.Error()).To(ContainSubstring("unknown error")) }) - It("should exit without errors as approval is required to be able to reconcile job", func() { - fakeConsoleClient := mocks.NewClientMock(mocks.TestingT) - fakeConsoleClient.On("GetStackRun", mock.Anything).Return(&console.StackRunFragment{ - ID: stackRunId, - Approval: lo.ToPtr(true), - }, nil) - - reconciler := stacks.NewStackReconciler(fakeConsoleClient, kClient, time.Minute, namespace, "", "") - - _, err := reconciler.Reconcile(ctx, stackRunId) - Expect(err).NotTo(HaveOccurred()) - }) - It("should exit without errors as job is already created", func() { fakeConsoleClient := mocks.NewClientMock(mocks.TestingT) fakeConsoleClient.On("GetStackRun", mock.Anything).Return(&console.StackRunFragment{