소스 검색

Block excessive, and azure provider to provider creation function, expand azure storage config

Sean Holcomb 4 년 전
부모
커밋
d5b34006e0
4개의 변경된 파일13개의 추가작업 그리고 7개의 파일을 삭제
  1. 3 3
      pkg/cloud/awsprovider.go
  2. 4 3
      pkg/cloud/azureprovider.go
  3. 1 1
      pkg/cloud/gcpprovider.go
  4. 5 0
      pkg/cloud/provider.go

+ 3 - 3
pkg/cloud/awsprovider.go

@@ -2366,7 +2366,7 @@ func (aws *AWS) ParseID(id string) string {
 	match := rx.FindStringSubmatch(id)
 	if len(match) < 2 {
 		if id != "" {
-			log.Infof("awsprovider.ParseID: failed to parse %s", id)
+			log.DedupedInfof(5, "awsprovider.ParseID: failed to parse %s", id)
 		}
 		return id
 	}
@@ -2379,7 +2379,7 @@ func (aws *AWS) ParsePVID(id string) string {
 	match := rx.FindStringSubmatch(id)
 	if len(match) < 2 {
 		if id != "" {
-			log.Infof("awsprovider.ParseID: failed to parse %s", id)
+			log.DedupedInfof(5,"awsprovider.ParseID: failed to parse %s", id)
 		}
 		return id
 	}
@@ -2392,7 +2392,7 @@ func (aws *AWS) ParseLBID(id string) string {
 	match := rx.FindStringSubmatch(id)
 	if len(match) < 2 {
 		if id != "" {
-			log.Infof("awsprovider.ParseLBID: failed to parse %s, %v", id, match)
+			log.DedupedInfof(5, "awsprovider.ParseLBID: failed to parse %s, %v", id, match)
 		}
 		return id
 	}

+ 4 - 3
pkg/cloud/azureprovider.go

@@ -265,9 +265,10 @@ func (k *azureKey) GetGPUCount() string {
 
 // Represents an azure storage config
 type AzureStorageConfig struct {
-	AccountName   string `json:"azureStorageAccount"`
-	AccessKey     string `json:"azureStorageAccessKey"`
-	ContainerName string `json:"azureStorageContainer"`
+	SubscriptionId string `json:"azureSubscriptionID"`
+	AccountName    string `json:"azureStorageAccount"`
+	AccessKey      string `json:"azureStorageAccessKey"`
+	ContainerName  string `json:"azureStorageContainer"`
 }
 
 // Represents an azure app key

+ 1 - 1
pkg/cloud/gcpprovider.go

@@ -1479,7 +1479,7 @@ func (gcp *GCP) ParseID(id string) string {
 	match := rx.FindStringSubmatch(id)
 	if len(match) < 2 {
 		if id != "" {
-			log.Infof("gcpprovider.ParseID: failed to parse %s", id)
+			log.DedupedInfof(5,"gcpprovider.ParseID: failed to parse %s", id)
 		}
 		return id
 	}

+ 5 - 0
pkg/cloud/provider.go

@@ -347,6 +347,11 @@ func NewCrossClusterProvider(ctype string, overrideConfigPath string, cache clus
 			Clientset: cache,
 			Config:    NewProviderConfig(overrideConfigPath),
 		}, nil
+	} else if ctype == "azure" {
+		return &Azure{
+			Clientset: cache,
+			Config:    NewProviderConfig(overrideConfigPath),
+		}, nil
 	}
 	return &CustomProvider{
 		Clientset: cache,