Skip to content

Commit

Permalink
Refactor and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mvshao committed Sep 5, 2024
1 parent 08cc2d7 commit 25f37f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ func sFnConfigureAuditLog(ctx context.Context, m *fsm, s *systemState) (stateFn,
"False",
err.Error(),
)
return updateStatusAndRequeueAfter(gardenerRequeueDuration)
} else {
s.instance.UpdateStateReady(
imv1.ConditionTypeAuditLogConfigured,
imv1.ConditionReasonAuditLogConfigured,
"Audit Log configured successfully",
)
}

s.instance.UpdateStateReady(
imv1.ConditionTypeAuditLogConfigured,
imv1.ConditionReasonAuditLogConfigured,
"Audit Log configured successfully",
)

return updateStatusAndStop()
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestAuditLogState(t *testing.T) {
assert.Equal(t, expectedRuntimeConditions, systemState.instance.Status.Conditions)
})

t.Run("Should requeue in case of error during configuration and set status on Runtime CR", func(t *testing.T) {
t.Run("Should stop in case of error during configuration and set status on Runtime CR", func(t *testing.T) {
// given
ctx := context.Background()
auditLog := &mocks.AuditLogging{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func sFnWaitForShootCreation(_ context.Context, m *fsm, s *systemState) (stateFn
m.log.Info("Waiting for shoot creation state")

switch s.shoot.Status.LastOperation.State {
case gardener.LastOperationStateProcessing, gardener.LastOperationStatePending, gardener.LastOperationStateAborted:
case gardener.LastOperationStateProcessing, gardener.LastOperationStatePending, gardener.LastOperationStateAborted, gardener.LastOperationStateError:
m.log.Info(fmt.Sprintf("Shoot %s is in %s state, scheduling for retry", s.shoot.Name, s.shoot.Status.LastOperation.State))

s.instance.UpdateStatePending(
Expand Down

0 comments on commit 25f37f3

Please sign in to comment.