Remove all legacy config
This commit is contained in:
14
cmd/root.go
14
cmd/root.go
@@ -10,8 +10,6 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/config"
|
||||
gitearemote "gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/gitea"
|
||||
gitlabremote "gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/gitlab"
|
||||
)
|
||||
|
||||
var conf config.Config
|
||||
@@ -111,7 +109,6 @@ func initConfig() {
|
||||
}
|
||||
|
||||
checkConfigPerms(viper.ConfigFileUsed()) // Abort on world-readable config
|
||||
setConfigFields() // Final chance to update config struct
|
||||
|
||||
plog.Debug("Configuration loaded", plog.Args("conf", conf))
|
||||
}
|
||||
@@ -133,17 +130,6 @@ func getPtermLogLevel(level string) pterm.LogLevel {
|
||||
return pLevel
|
||||
}
|
||||
|
||||
// Do any post-processing of configuration here
|
||||
func setConfigFields() {
|
||||
// Load Gitlabs
|
||||
glRemotes := gitlabremote.GitlabRemote{}
|
||||
conf.Remotes = append(conf.Remotes, glRemotes.GetInfos(conf)...)
|
||||
|
||||
// Load Giteas
|
||||
giteaRemotes := gitearemote.GiteaRemote{}
|
||||
conf.Remotes = append(conf.Remotes, giteaRemotes.GetInfos(conf)...)
|
||||
}
|
||||
|
||||
// Don't allow world-readable configuration
|
||||
func checkConfigPerms(file string) {
|
||||
stat, err := os.Stat(file)
|
||||
|
||||
Reference in New Issue
Block a user