From 2f5d515e430d378f4412234d97ad2d552325809c Mon Sep 17 00:00:00 2001 From: MichalKalke Date: Fri, 5 Apr 2024 13:11:58 +0200 Subject: [PATCH] Delete unused things --- .../operator/api/v1alpha1/groupversion_info.go | 1 - .../internal/state/controller_configuration.go | 12 ------------ components/operator/internal/state/state.go | 4 ---- 3 files changed, 17 deletions(-) diff --git a/components/operator/api/v1alpha1/groupversion_info.go b/components/operator/api/v1alpha1/groupversion_info.go index 1c523975b..c96cbd925 100644 --- a/components/operator/api/v1alpha1/groupversion_info.go +++ b/components/operator/api/v1alpha1/groupversion_info.go @@ -27,7 +27,6 @@ import ( const ( ServerlessGroup = "operator.kyma-project.io" ServerlessVersion = "v1alpha1" - ServerlessKind = "Serverless" ) var ( diff --git a/components/operator/internal/state/controller_configuration.go b/components/operator/internal/state/controller_configuration.go index 244e89aa1..715ff43cf 100644 --- a/components/operator/internal/state/controller_configuration.go +++ b/components/operator/internal/state/controller_configuration.go @@ -4,9 +4,7 @@ import ( "context" "github.com/kyma-project/serverless/components/operator/api/v1alpha1" - corev1 "k8s.io/api/core/v1" controllerruntime "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( @@ -60,13 +58,3 @@ func configureControllerConfigurationFlags(s *systemState) { s.instance.Status.DefaultRuntimePodPreset, ) } - -func getNodesLen(ctx context.Context, c client.Client) (int, error) { - nodeList := corev1.NodeList{} - err := c.List(ctx, &nodeList) - if err != nil { - return 0, err - } - - return len(nodeList.Items), nil -} diff --git a/components/operator/internal/state/state.go b/components/operator/internal/state/state.go index 4b911d727..7523ad601 100644 --- a/components/operator/internal/state/state.go +++ b/components/operator/internal/state/state.go @@ -12,10 +12,6 @@ var requeueResult = &ctrl.Result{ Requeue: true, } -func stopWithErrorOrRequeue(err error) (stateFn, *ctrl.Result, error) { - return nil, requeueResult, err -} - func nextState(next stateFn) (stateFn, *ctrl.Result, error) { return next, nil, nil }