Logs provider name on startup

If invalid provider is specified, stop and error out

fixes #895
This commit is contained in:
Arcadiy Ivanov
2020-11-12 10:39:35 -05:00
parent 6254ed24ea
commit 45ae87e4b7
3 changed files with 12 additions and 2 deletions
+7 -1
View File
@@ -233,7 +233,13 @@ func parseProviderInfo(o *options.Options, msgs []string) []string {
p.ValidateURL, msgs = parseURL(o.ValidateURL, "validate", msgs)
p.ProtectedResource, msgs = parseURL(o.ProtectedResource, "resource", msgs)
o.SetProvider(providers.New(o.ProviderType, p))
provider := providers.New(o.ProviderType, p)
if provider == nil {
msgs = append(msgs, fmt.Sprintf("invalid setting: provider '%s' is not available", o.ProviderType))
return msgs
}
o.SetProvider(provider)
switch p := o.GetProvider().(type) {
case *providers.AzureProvider:
p.Configure(o.AzureTenant)