diff --git a/cluster-autoscaler/cloudprovider/azure/azure_util.go b/cluster-autoscaler/cloudprovider/azure/azure_util.go index aa6a076dfed..babdbead32d 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_util.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_util.go @@ -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") @@ -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 }