Skip to content

Commit

Permalink
Cleanup unused configuration fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kwiatekus committed Apr 29, 2024
1 parent c98bb8e commit 08ccde2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
10 changes: 0 additions & 10 deletions components/operator/internal/state/controller_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func sFnControllerConfiguration(ctx context.Context, r *reconciler, s *systemSta
}

configureControllerConfigurationFlags(s)
warnAboutDeadFields(s)

s.setState(v1alpha1.StateProcessing)
s.instance.UpdateConditionTrue(
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
})
}


Expand Down

0 comments on commit 08ccde2

Please sign in to comment.