Ajay Tripathy 5 лет назад
Родитель
Сommit
8cd4c81bf1
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      pkg/cloud/awsprovider.go

+ 3 - 2
pkg/cloud/awsprovider.go

@@ -38,7 +38,6 @@ import (
 	v1 "k8s.io/api/core/v1"
 )
 
-const awsReservedInstancePricePerHour = 0.0287
 const supportedSpotFeedVersion = "1"
 const SpotInfoUpdateType = "spotinfo"
 const AthenaInfoUpdateType = "athenainfo"
@@ -134,6 +133,7 @@ type AWS struct {
 	BaseGPUPrice                string
 	BaseSpotCPUPrice            string
 	BaseSpotRAMPrice            string
+	BaseSpotGPUPrice            string
 	SpotLabelName               string
 	SpotLabelValue              string
 	SpotDataRegion              string
@@ -616,6 +616,7 @@ func (aws *AWS) DownloadPricingData() error {
 	aws.BaseGPUPrice = c.GPU
 	aws.BaseSpotCPUPrice = c.SpotCPU
 	aws.BaseSpotRAMPrice = c.SpotRAM
+	aws.BaseSpotGPUPrice = c.SpotGPU
 	aws.SpotLabelName = c.SpotLabel
 	aws.SpotLabelValue = c.SpotLabelValue
 	aws.SpotDataBucket = c.SpotDataBucket
@@ -1898,7 +1899,7 @@ func (a *AWS) ExternalAllocations(start string, end string, aggregators []string
 	processResults := func(op *athena.GetQueryResultsOutput, lastpage bool) bool {
 		iter := op.ResultSet.Rows
 		if page == 0 && len(iter) > 0 {
-			iter = op.ResultSet.Rows[1:(len(op.ResultSet.Rows))]
+			iter = op.ResultSet.Rows[1:len(op.ResultSet.Rows)]
 		}
 		page++
 		for _, r := range iter {