X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1b6b38c5d2e181f357cab883b63917cb5eaa778c..79bce4a71a58118a9003882e0ca9bbfb9d2957a9:/lib/config/load.go diff --git a/lib/config/load.go b/lib/config/load.go index 93c36f69ed..be6181bbe9 100644 --- a/lib/config/load.go +++ b/lib/config/load.go @@ -15,7 +15,7 @@ import ( "os" "strings" - "git.curoverse.com/arvados.git/sdk/go/arvados" + "git.arvados.org/arvados.git/sdk/go/arvados" "github.com/ghodss/yaml" "github.com/imdario/mergo" "github.com/sirupsen/logrus" @@ -37,6 +37,7 @@ type Loader struct { WebsocketPath string KeepproxyPath string GitHttpdPath string + KeepBalancePath string configdata []byte } @@ -63,13 +64,16 @@ func NewLoader(stdin io.Reader, logger logrus.FieldLogger) *Loader { // // ldr.Path == "/tmp/c.yaml" func (ldr *Loader) SetupFlags(flagset *flag.FlagSet) { flagset.StringVar(&ldr.Path, "config", arvados.DefaultConfigFile, "Site configuration `file` (default may be overridden by setting an ARVADOS_CONFIG environment variable)") - flagset.StringVar(&ldr.KeepstorePath, "legacy-keepstore-config", defaultKeepstoreConfigPath, "Legacy keepstore configuration `file`") - flagset.StringVar(&ldr.KeepWebPath, "legacy-keepweb-config", defaultKeepWebConfigPath, "Legacy keep-web configuration `file`") - flagset.StringVar(&ldr.CrunchDispatchSlurmPath, "legacy-crunch-dispatch-slurm-config", defaultCrunchDispatchSlurmConfigPath, "Legacy crunch-dispatch-slurm configuration `file`") - flagset.StringVar(&ldr.WebsocketPath, "legacy-ws-config", defaultWebsocketConfigPath, "Legacy arvados-ws configuration `file`") - flagset.StringVar(&ldr.KeepproxyPath, "legacy-keepproxy-config", defaultKeepproxyConfigPath, "Legacy keepproxy configuration `file`") - flagset.StringVar(&ldr.GitHttpdPath, "legacy-git-httpd-config", defaultGitHttpdConfigPath, "Legacy arv-git-httpd configuration `file`") - flagset.BoolVar(&ldr.SkipLegacy, "skip-legacy", false, "Don't load legacy config files") + if !ldr.SkipLegacy { + flagset.StringVar(&ldr.KeepstorePath, "legacy-keepstore-config", defaultKeepstoreConfigPath, "Legacy keepstore configuration `file`") + flagset.StringVar(&ldr.KeepWebPath, "legacy-keepweb-config", defaultKeepWebConfigPath, "Legacy keep-web configuration `file`") + flagset.StringVar(&ldr.CrunchDispatchSlurmPath, "legacy-crunch-dispatch-slurm-config", defaultCrunchDispatchSlurmConfigPath, "Legacy crunch-dispatch-slurm configuration `file`") + flagset.StringVar(&ldr.WebsocketPath, "legacy-ws-config", defaultWebsocketConfigPath, "Legacy arvados-ws configuration `file`") + flagset.StringVar(&ldr.KeepproxyPath, "legacy-keepproxy-config", defaultKeepproxyConfigPath, "Legacy keepproxy configuration `file`") + flagset.StringVar(&ldr.GitHttpdPath, "legacy-git-httpd-config", defaultGitHttpdConfigPath, "Legacy arv-git-httpd configuration `file`") + flagset.StringVar(&ldr.KeepBalancePath, "legacy-keepbalance-config", defaultKeepBalanceConfigPath, "Legacy keep-balance configuration `file`") + flagset.BoolVar(&ldr.SkipLegacy, "skip-legacy", false, "Don't load legacy config files") + } } // MungeLegacyConfigArgs checks args for a -config flag whose argument @@ -149,6 +153,9 @@ func (ldr *Loader) MungeLegacyConfigArgs(lgr logrus.FieldLogger, args []string, if legacyConfigArg != "-legacy-git-httpd-config" { ldr.GitHttpdPath = "" } + if legacyConfigArg != "-legacy-keepbalance-config" { + ldr.KeepBalancePath = "" + } return munged } @@ -245,12 +252,14 @@ func (ldr *Loader) Load() (*arvados.Config, error) { // * no primary config was loaded, and this is the // legacy config file for the current component for _, err := range []error{ + ldr.loadOldEnvironmentVariables(&cfg), ldr.loadOldKeepstoreConfig(&cfg), ldr.loadOldKeepWebConfig(&cfg), ldr.loadOldCrunchDispatchSlurmConfig(&cfg), ldr.loadOldWebsocketConfig(&cfg), ldr.loadOldKeepproxyConfig(&cfg), ldr.loadOldGitHttpdConfig(&cfg), + ldr.loadOldKeepBalanceConfig(&cfg), } { if err != nil { return nil, err @@ -262,7 +271,6 @@ func (ldr *Loader) Load() (*arvados.Config, error) { for id, cc := range cfg.Clusters { for _, err = range []error{ checkKeyConflict(fmt.Sprintf("Clusters.%s.PostgreSQL.Connection", id), cc.PostgreSQL.Connection), - ldr.checkPendingKeepstoreMigrations(cc), ldr.checkEmptyKeepstores(cc), ldr.checkUnlistedKeepstores(cc), } {