Skip to content

Commit a75f804

Browse files
authored
do not require approval to create stack run jobs (#193)
1 parent ee730c9 commit a75f804

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

pkg/controller/stacks/reconciler.go

-5
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,6 @@ func (r *StackReconciler) Reconcile(ctx context.Context, id string) (reconcile.R
108108
return reconcile.Result{}, err
109109
}
110110

111-
// If approval is required but not done yet, exit.
112-
if stackRun.Approval != nil && *stackRun.Approval && stackRun.ApprovedAt == nil {
113-
return reconcile.Result{}, nil
114-
}
115-
116111
_, err = r.reconcileRunJob(ctx, stackRun)
117112
return reconcile.Result{}, err
118113
}

pkg/controller/stacks/reconciler_test.go

-13
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,6 @@ var _ = Describe("Reconciler", Ordered, func() {
9191
Expect(err.Error()).To(ContainSubstring("unknown error"))
9292
})
9393

94-
It("should exit without errors as approval is required to be able to reconcile job", func() {
95-
fakeConsoleClient := mocks.NewClientMock(mocks.TestingT)
96-
fakeConsoleClient.On("GetStackRun", mock.Anything).Return(&console.StackRunFragment{
97-
ID: stackRunId,
98-
Approval: lo.ToPtr(true),
99-
}, nil)
100-
101-
reconciler := stacks.NewStackReconciler(fakeConsoleClient, kClient, time.Minute, namespace, "", "")
102-
103-
_, err := reconciler.Reconcile(ctx, stackRunId)
104-
Expect(err).NotTo(HaveOccurred())
105-
})
106-
10794
It("should exit without errors as job is already created", func() {
10895
fakeConsoleClient := mocks.NewClientMock(mocks.TestingT)
10996
fakeConsoleClient.On("GetStackRun", mock.Anything).Return(&console.StackRunFragment{

0 commit comments

Comments
 (0)