From fee49ee742fc98dbd3d0b539bbd558bf64432a05 Mon Sep 17 00:00:00 2001 From: Yevgeniy Safronov Date: Wed, 5 Jan 2022 14:58:26 -0500 Subject: [PATCH] removed depreacted configs --- config.go | 38 +++----------------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/config.go b/config.go index a4442916..49a9b217 100644 --- a/config.go +++ b/config.go @@ -290,7 +290,7 @@ type ControlServerConfig struct { ServerBindAddr string // Path to `web` base dir - WebBasedir string + WebBasedir string // TODO: refactor control server config out of the base ferry at some point // This adds optional buttons in the web ui that runs a script located at the @@ -788,14 +788,6 @@ type Config struct { // The following configs are updatable via the `Config.Update` method and should be passed by pointer UpdatableConfig UpdatableConfig - - // ---------------------------------------------------------------------------------------------------------------- - // DEPRECATED CONFIGS - // The following configs are deprecated - DataIterationBatchSize uint64 // replaced by UpdatableConfig.DataIterationBatchSize - ServerBindAddr string // replaced by ControlServerConfig.ServerBindAddr - WebBasedir string // replaced by ControlServerConfig.WebBasedir - ControlServerCustomScripts map[string][]string // replaced by ControlServerConfig.CustomScripts } func (c *Config) ValidateConfig() error { @@ -829,13 +821,11 @@ func (c *Config) ValidateConfig() error { c.ControlServerConfig = &ControlServerConfig{} } - c.checkForDeprecatedConfig() - if err := c.ControlServerConfig.Validate(); err != nil { return fmt.Errorf("control_server: %s", err) } - if c.DBWriteRetries == 0 { + if c.DBWriteRetries == 0 { c.DBWriteRetries = 5 } @@ -870,29 +860,7 @@ func (c *Config) ValidateConfig() error { return nil } -func (c *Config) checkForDeprecatedConfig() { - if c.DataIterationBatchSize != 0 { - c.logDeprecated("DataIterationBatchSize", "UpdatableConfig.DataIterationBatchSize") - c.UpdatableConfig.DataIterationBatchSize = c.DataIterationBatchSize - } - - if c.ServerBindAddr != "" { - c.logDeprecated("ServerBindAddr", "ControlServerConfig.ServerBindAddr") - c.ControlServerConfig.ServerBindAddr = c.ServerBindAddr - } - - if c.WebBasedir != "" { - c.logDeprecated("WebBasedir", "ControlServerConfig.WebBasedir") - c.ControlServerConfig.WebBasedir = c.WebBasedir - } - - if len(c.ControlServerCustomScripts) != 0 { - c.logDeprecated("ControlServerCustomScripts", "ControlServerConfig.CustomScripts") - c.ControlServerConfig.CustomScripts= c.ControlServerCustomScripts - } -} - -func (c *Config) logDeprecated(deprecatedConfig string, newConfig string) { +func (c *Config) logDeprecated(deprecatedConfig string, newConfig string) { logrus.Warnf("Config.%s is deprecated in favour of Config.%s", deprecatedConfig, newConfig) }