Skip to content

Commit

Permalink
Validate all parameters even when using managed identity
Browse files Browse the repository at this point in the history
  • Loading branch information
fiunchinho committed Nov 19, 2019
1 parent 30256a6 commit 92d6329
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions cluster-autoscaler/cloudprovider/azure/azure_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,22 +525,6 @@ func validateConfig(cfg *Config) error {
return fmt.Errorf("resource group not set")
}

if cfg.SubscriptionID == "" {
return fmt.Errorf("subscription ID not set")
}

if cfg.UseManagedIdentityExtension {
return nil
}

if cfg.TenantID == "" {
return fmt.Errorf("tenant ID not set")
}

if cfg.AADClientID == "" {
return fmt.Errorf("ARM Client ID not set")
}

if cfg.VMType == vmTypeStandard {
if cfg.Deployment == "" {
return fmt.Errorf("deployment not set")
Expand All @@ -558,6 +542,22 @@ func validateConfig(cfg *Config) error {
}
}

if cfg.SubscriptionID == "" {
return fmt.Errorf("subscription ID not set")
}

if cfg.UseManagedIdentityExtension {
return nil
}

if cfg.TenantID == "" {
return fmt.Errorf("tenant ID not set")
}

if cfg.AADClientID == "" {
return fmt.Errorf("ARM Client ID not set")
}

return nil
}

Expand Down

0 comments on commit 92d6329

Please sign in to comment.