From fdc0db07e080d957793c42923d1a6efc4c307def Mon Sep 17 00:00:00 2001 From: "Quentin McGaw (desktop)" Date: Sat, 22 Jan 2022 22:23:14 +0000 Subject: [PATCH] fix(updater): do not allow or set custom provider --- internal/cli/update.go | 7 ++++++- internal/configuration/settings/updater.go | 4 ++++ internal/configuration/sources/env/updater.go | 7 ++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/cli/update.go b/internal/cli/update.go index b2890231..b50b8564 100644 --- a/internal/cli/update.go +++ b/internal/cli/update.go @@ -65,7 +65,12 @@ func (c *CLI) Update(ctx context.Context, args []string, logger UpdaterLogger) e } if updateAll { - options.Providers = constants.AllProviders() + for _, provider := range constants.AllProviders() { + if provider == constants.Custom { + continue + } + options.Providers = append(options.Providers, provider) + } } else { if csvProviders == "" { return ErrNoProviderSpecified diff --git a/internal/configuration/settings/updater.go b/internal/configuration/settings/updater.go index 05c281dc..8857aecc 100644 --- a/internal/configuration/settings/updater.go +++ b/internal/configuration/settings/updater.go @@ -43,6 +43,10 @@ func (u Updater) Validate() (err error) { for i, provider := range u.Providers { valid := false for _, validProvider := range constants.AllProviders() { + if validProvider == constants.Custom { + continue + } + if provider == validProvider { valid = true break diff --git a/internal/configuration/sources/env/updater.go b/internal/configuration/sources/env/updater.go index 1a9fdfa7..4d573d92 100644 --- a/internal/configuration/sources/env/updater.go +++ b/internal/configuration/sources/env/updater.go @@ -22,7 +22,12 @@ func readUpdater() (updater settings.Updater, err error) { } // TODO use current provider being used - updater.Providers = constants.AllProviders() + for _, provider := range constants.AllProviders() { + if provider == constants.Custom { + continue + } + updater.Providers = append(updater.Providers, provider) + } return updater, nil }