diff --git a/internal/controller/runtime/fsm/runtime_fsm_apply_crb_test.go b/internal/controller/runtime/fsm/runtime_fsm_apply_crb_test.go index c42bbdab..23d1080d 100644 --- a/internal/controller/runtime/fsm/runtime_fsm_apply_crb_test.go +++ b/internal/controller/runtime/fsm/runtime_fsm_apply_crb_test.go @@ -133,6 +133,7 @@ var _ = Describe(`runtime_fsm_apply_crb`, Label("applyCRB"), func() { // initialize test data if required Expect(tc.init()).ShouldNot(HaveOccurred()) + //TODO change timeout ctx, cancel := context.WithTimeout(context.Background(), time.Second*10000) defer cancel() @@ -175,6 +176,7 @@ var _ = Describe(`runtime_fsm_apply_crb`, Label("applyCRB"), func() { }), Entry("error getting client", tcApplySfn{ + instance: testRuntime, expected: tcSfnExpected{ err: testErr, }, @@ -184,7 +186,16 @@ var _ = Describe(`runtime_fsm_apply_crb`, Label("applyCRB"), func() { withFn(sFnApplyClusterRoleBindings), withFakeEventRecorder(1), ), - setup: defaultSetup, + setup: func(f *fsm) error { + GetShootClient = func( + _ context.Context, + _ client.SubResourceClient, + _ *gardener_api.Shoot) (client.Client, error) { + return nil, testErr + } + return nil + + }, }), ) }) diff --git a/internal/controller/runtime/fsm/runtime_fsm_create_kubeconfig_test.go b/internal/controller/runtime/fsm/runtime_fsm_create_kubeconfig_test.go index 43459124..e3478ae0 100644 --- a/internal/controller/runtime/fsm/runtime_fsm_create_kubeconfig_test.go +++ b/internal/controller/runtime/fsm/runtime_fsm_create_kubeconfig_test.go @@ -3,9 +3,10 @@ package fsm import ( "context" "fmt" - "k8s.io/utils/ptr" "time" + "k8s.io/utils/ptr" + gardener "github.com/gardener/gardener/pkg/apis/core/v1beta1" imv1 "github.com/kyma-project/infrastructure-manager/api/v1" . "github.com/onsi/ginkgo/v2" //nolint:revive @@ -99,7 +100,7 @@ var _ = Describe("KIM sFnCreateKubeconfig", func() { &systemState{instance: *inputRtWithLabelsAndCondition, shoot: &testShoot}, testOpts{ MatchExpectedErr: BeNil(), - MatchNextFnState: haveName("sFnProcessShoot"), + MatchNextFnState: haveName("sFnApplyClusterRoleBindings"), }, ), Entry(