From a8c11c557c62e36c12c776e41b8fa62ad440f7a2 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 12 Dec 2024 18:05:31 +0800 Subject: [PATCH] remove unused method. --- pkg/common/config/load_config.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pkg/common/config/load_config.go b/pkg/common/config/load_config.go index 28330cfcb..aa87211f9 100644 --- a/pkg/common/config/load_config.go +++ b/pkg/common/config/load_config.go @@ -41,23 +41,3 @@ func loadConfig(path string, envPrefix string, config any) error { } return nil } - -func loadConfigK8s(mountPath string, envPrefix string, config any) error { - // configFilePath := filepath.Join(mountPath, configFileName) - v := viper.New() - v.SetConfigFile(mountPath) - v.SetEnvPrefix(envPrefix) - v.AutomaticEnv() - v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) - - if err := v.ReadInConfig(); err != nil { - return errs.WrapMsg(err, "failed to read config file", "path", mountPath, "envPrefix", envPrefix) - } - - if err := v.Unmarshal(config, func(config *mapstructure.DecoderConfig) { - config.TagName = "mapstructure" - }); err != nil { - return errs.WrapMsg(err, "failed to unmarshal config", "path", mountPath, "envPrefix", envPrefix) - } - return nil -}