Skip to content

Commit

Permalink
do not require approval to create stack run jobs (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm authored May 22, 2024
1 parent ee730c9 commit a75f804
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
5 changes: 0 additions & 5 deletions pkg/controller/stacks/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
13 changes: 0 additions & 13 deletions pkg/controller/stacks/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit a75f804

Please sign in to comment.