Skip to content

Commit

Permalink
fix for Requeue after adding finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
koala7659 committed Jun 25, 2024
1 parent 7d40059 commit a97b3d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/controller/runtime/fsm/runtime_fsm_initialise.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func sFnInitialize(ctx context.Context, m *fsm, s *systemState) (stateFn, *ctrl.

if instanceIsNotBeingDeleted && s.shoot != nil {
m.log.Info("Gardener shoot exists, processing")
return switchState(sFnPrepareCluster) // wait for operation to complete
return switchState(sFnPrepareCluster) // wait for pending shoot operation to complete
}

if !instanceIsNotBeingDeleted && instanceHasFinalizer && s.shoot != nil {
Expand All @@ -62,7 +62,7 @@ func addFinalizerAndRequeue(ctx context.Context, m *fsm, s *systemState) (stateF
if err != nil {
return stopWithErrorAndNoRequeue(err)
}
return nil, nil, nil
return nil, &ctrl.Result{Requeue: true}, nil
}

func removeFinalizerAndStop(ctx context.Context, m *fsm, s *systemState) (stateFn, *ctrl.Result, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/runtime/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func fixGardenerShootsForProvisioning(shoot *gardener_api.Shoot) []*gardener_api

//processedShoot := processingShoot.DeepCopy() // will add specific data later

return []*gardener_api.Shoot{missingShoot, missingShoot, initialisedShoot, processingShoot, readyShoot, readyShoot, readyShoot, readyShoot}
return []*gardener_api.Shoot{missingShoot, missingShoot, missingShoot, initialisedShoot, processingShoot, readyShoot, readyShoot, readyShoot, readyShoot}
}

func fixConverterConfigForTests() gardener_shoot.ConverterConfig {
Expand Down

0 comments on commit a97b3d7

Please sign in to comment.