Skip to content

Commit

Permalink
Merge pull request #534 from m00g3n/add-gardener-cluster-recover
Browse files Browse the repository at this point in the history
Add gardener cluster recovery for patch operations
  • Loading branch information
kyma-bot authored Nov 28, 2024
2 parents d75d9df + 1987b08 commit ef44cc6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
kubeconfigSecretKey = "config"
)

func sFnCreateKubeconfig(ctx context.Context, m *fsm, s *systemState) (stateFn, *ctrl.Result, error) {
func sFnHandleKubeconfig(ctx context.Context, m *fsm, s *systemState) (stateFn, *ctrl.Result, error) {
m.log.Info("Create Gardener Cluster CR state")

runtimeID := s.instance.Labels[imv1.LabelKymaRuntimeID]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var _ = Describe("KIM sFnCreateKubeconfig", func() {
},
}

testFunction := buildTestFunction(sFnCreateKubeconfig)
testFunction := buildTestFunction(sFnHandleKubeconfig)

// WHEN/THAN

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/runtime/fsm/runtime_fsm_patch_shoot.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func sFnPatchExistingShoot(ctx context.Context, m *fsm, s *systemState) (stateFn

if updatedShoot.Generation == s.shoot.Generation {
m.log.Info("Gardener shoot for runtime did not change after patch, moving to processing", "Name", s.shoot.Name, "Namespace", s.shoot.Namespace)
return switchState(sFnConfigureOidc)
return switchState(sFnHandleKubeconfig)
}

m.log.Info("Gardener shoot for runtime patched successfully", "Name", s.shoot.Name, "Namespace", s.shoot.Namespace)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func sFnWaitForShootReconcile(_ context.Context, m *fsm, s *systemState) (stateF
imv1.ConditionTypeRuntimeProvisioned,
imv1.ConditionReasonConfigurationCompleted,
"Runtime processing completed successfully",
sFnConfigureOidc)
sFnHandleKubeconfig)
}

m.log.Info("sFnWaitForShootReconcile - unknown shoot operation state, stopping state machine", "RuntimeCR", s.instance.Name, "shoot", s.shoot.Name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func sFnWaitForShootCreation(_ context.Context, m *fsm, s *systemState) (stateFn
imv1.ConditionTypeRuntimeProvisioned,
imv1.ConditionReasonShootCreationCompleted,
"Shoot creation completed",
sFnCreateKubeconfig)
sFnHandleKubeconfig)

default:
m.log.Info("WaitForShootCreation - unknown shoot operation state, stopping state machine", "RuntimeCR", s.instance.Name, "shoot", s.shoot.Name)
Expand Down

0 comments on commit ef44cc6

Please sign in to comment.