Selaa lähdekoodia

Add enabled field

Bianca Burtoiu 4 vuotta sitten
vanhempi
sitoutus
3e333cb125
3 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 3 0
      pkg/cloud/awsprovider.go
  2. 1 0
      pkg/cloud/azureprovider.go
  3. 1 0
      pkg/cloud/provider.go

+ 3 - 0
pkg/cloud/awsprovider.go

@@ -57,11 +57,13 @@ func (aws *AWS) PricingSourceStatus() map[string]*PricingSource {
 
 	sps := &PricingSource{
 		Name: SpotPricingSource,
+		Enabled: true,
 	}
 
 	if !aws.SpotRefreshEnabled {
 		sps.Available = false
 		sps.Error = "Spot instances not set up"
+		sps.Enabled = false
 	} else {
 		sps.Error = ""
 		if aws.SpotPricingError != nil {
@@ -79,6 +81,7 @@ func (aws *AWS) PricingSourceStatus() map[string]*PricingSource {
 
 	rps := &PricingSource{
 		Name: ReservedInstancePricingSource,
+		Enabled: true,
 	}
 	rps.Error = ""
 	if aws.RIPricingError != nil {

+ 1 - 0
pkg/cloud/azureprovider.go

@@ -1269,6 +1269,7 @@ func (az *Azure) PricingSourceStatus() map[string]*PricingSource {
 	}
 	rcps := &PricingSource{
 		Name:  rateCardPricingSource,
+		Enabled: true,
 		Error: errMsg,
 	}
 	if rcps.Error != "" {

+ 1 - 0
pkg/cloud/provider.go

@@ -257,6 +257,7 @@ type PricingSources struct {
 
 type PricingSource struct {
 	Name      string `json:"name"`
+	Enabled   bool   `json:"enabled"`
 	Available bool   `json:"available"`
 	Error     string `json:"error"`
 }