From 9b1f1083e6890821977da5db2e028825354a87ac Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Mon, 18 Nov 2024 19:02:30 -0500 Subject: [PATCH] Remove SetConfig Signed-off-by: Eduardo Apolinario --- .../flytek8s/k8s_resource_adds_test.go | 13 ++++++------- flytepropeller/pkg/controller/config/config.go | 5 ----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go index e215e23ee6..09506d155a 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go @@ -382,13 +382,12 @@ func TestDecorateEnvVars(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - assert.NoError(t, propellerCfg.SetConfig(&propellerCfg.Config{ - LiteralOffloadingConfig: propellerCfg.LiteralOffloadingConfig{ - Enabled: tt.offloadingEnabled, - MinSizeInMBForOffloading: 1, - MaxSizeInMBForOffloading: 42, - }, - })) + cfg := propellerCfg.GetConfig() + cfg.LiteralOffloadingConfig = propellerCfg.LiteralOffloadingConfig{ + Enabled: tt.offloadingEnabled, + MinSizeInMBForOffloading: 1, + MaxSizeInMBForOffloading: 42, + } assert.NoError(t, config.SetK8sPluginConfig(&config.K8sPluginConfig{ DefaultEnvVars: tt.additionEnvVar, diff --git a/flytepropeller/pkg/controller/config/config.go b/flytepropeller/pkg/controller/config/config.go index 24b8e0032a..4801b8993a 100644 --- a/flytepropeller/pkg/controller/config/config.go +++ b/flytepropeller/pkg/controller/config/config.go @@ -356,11 +356,6 @@ func GetConfig() *Config { return configSection.GetConfig().(*Config) } -// SetConfig should be used for TESTING ONLY as it sets current value for the config. -func SetConfig(cfg *Config) error { - return configSection.SetConfig(cfg) -} - // MustRegisterSubSection can be used to configure any subsections the the propeller configuration func MustRegisterSubSection(subSectionKey string, section config.Config) config.Section { return configSection.MustRegisterSection(subSectionKey, section)