From 08ccde2c217a1ea97ad33fcf6b673fd9aca9d070 Mon Sep 17 00:00:00 2001 From: "Kwiatosz, Krzysztof" Date: Mon, 29 Apr 2024 08:42:20 +0200 Subject: [PATCH] Cleanup unused configuration fields --- .../internal/state/controller_configuration.go | 10 ---------- .../state/controller_configuration_test.go | 14 -------------- 2 files changed, 24 deletions(-) diff --git a/components/operator/internal/state/controller_configuration.go b/components/operator/internal/state/controller_configuration.go index 091d14b07..2c6a96ec9 100644 --- a/components/operator/internal/state/controller_configuration.go +++ b/components/operator/internal/state/controller_configuration.go @@ -25,7 +25,6 @@ func sFnControllerConfiguration(ctx context.Context, r *reconciler, s *systemSta } configureControllerConfigurationFlags(s) - warnAboutDeadFields(s) s.setState(v1alpha1.StateProcessing) s.instance.UpdateConditionTrue( @@ -37,15 +36,6 @@ func sFnControllerConfiguration(ctx context.Context, r *reconciler, s *systemSta return nextState(sFnApplyResources) } -func warnAboutDeadFields(s *systemState) { - if s.instance.Spec.FunctionTimeoutSec != "" { - s.warningBuilder.With(functionTimeoutDepreciationMessage) - } - if s.instance.Spec.FunctionRequestBodyLimitMb != "" { - s.warningBuilder.With(functionRequestBodyLimitDepreciationMessage) - } -} - func updateControllerConfigurationStatus(ctx context.Context, r *reconciler, instance *v1alpha1.Serverless) error { nodesLen, err := getNodesLen(ctx, r.client) if err != nil { diff --git a/components/operator/internal/state/controller_configuration_test.go b/components/operator/internal/state/controller_configuration_test.go index f79bc8d46..9031f4bd8 100644 --- a/components/operator/internal/state/controller_configuration_test.go +++ b/components/operator/internal/state/controller_configuration_test.go @@ -232,20 +232,6 @@ func Test_sFnControllerConfiguration(t *testing.T) { configurationReadyMsg) require.Equal(t, v1alpha1.StateProcessing, s.instance.Status.State) }) - - t.Run("enable dead fields", func(t *testing.T) { - s := &systemState{ - warningBuilder: warning.NewBuilder(), - instance: v1alpha1.Serverless{ - Spec: v1alpha1.ServerlessSpec{ - FunctionRequestBodyLimitMb: requestBodyLimitMbTest, - FunctionTimeoutSec: timeoutSecTest, - }, - }, - } - warnAboutDeadFields(s) - require.Equal(t, fmt.Sprintf("Warning: %s; %s", functionTimeoutDepreciationMessage, functionRequestBodyLimitDepreciationMessage), s.warningBuilder.Build()) - }) }