Skip to content

Commit

Permalink
Merge pull request #2541 from fiunchinho/validate_all_params
Browse files Browse the repository at this point in the history
Validate all parameters even when using managed identity
  • Loading branch information
k8s-ci-robot authored Nov 25, 2019
2 parents 8024e2d + 92d6329 commit 017b8d6
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 017b8d6

Please sign in to comment.