Răsfoiți Sursa

return values from config if not set by secret

Signed-off-by: Duncan Bakker <dbakker1@lely.com>
Duncan Bakker 3 ani în urmă
părinte
comite
b0b03bf2ed
1 a modificat fișierele cu 3 adăugiri și 11 ștergeri
  1. 3 11
      pkg/cloud/azureprovider.go

+ 3 - 11
pkg/cloud/azureprovider.go

@@ -523,17 +523,9 @@ func (az *Azure) getAzureRateCardAuth(forceReload bool, cp *CustomPricing) (subs
 		tenantID = s.ServiceKey.Tenant
 		return
 	}
-	// 2. Check config values (set though endpoint)
-	if cp.AzureSubscriptionID != "" && cp.AzureClientID != "" && cp.AzureClientSecret != "" && cp.AzureTenantID != "" {
-		subscriptionID = cp.AzureSubscriptionID
-		clientID = cp.AzureClientID
-		clientSecret = cp.AzureClientSecret
-		tenantID = cp.AzureTenantID
-		return
-	}
 
-	// 3. Empty values
-	return "", "", "", ""
+	// 2. Return config values if not returned by Secret (set though endpoint)
+	return cp.AzureSubscriptionID, cp.AzureClientID, cp.AzureClientSecret, cp.AzureTenantID
 }
 
 // GetAzureStorageConfig retrieves storage config from secret and sets default values
@@ -576,7 +568,7 @@ func (az *Azure) GetAzureStorageConfig(forceReload bool, cp *CustomPricing) (*Az
 				Message: "Azure Storage Config exists",
 				Status:  true,
 			})
-			
+
 			return asc, nil
 		}
 	}