e2e: reject unknown providers

This finishes the work started for 1.13: instead of merely warning
about an unknown value given to --profile, the test/e2e/e2e.test
binary will now print an error and refuse to run.

Fixes: #70200
This commit is contained in:
Patrick Ohly
2019-01-28 14:35:23 +01:00
parent 8b98e802ed
commit f3d79e152e
2 changed files with 32 additions and 15 deletions

View File

@@ -45,6 +45,17 @@ func RegisterProvider(name string, factory Factory) {
providers[name] = factory
}
// GetProviders returns the names of all currently registered providers.
func GetProviders() []string {
mutex.Lock()
defer mutex.Unlock()
var providerNames []string
for name := range providers {
providerNames = append(providerNames, name)
}
return providerNames
}
func init() {
// "local" or "skeleton" can always be used.
RegisterProvider("local", func() (ProviderInterface, error) {