Browse Source

fmt space removal

Sean Holcomb 4 năm trước cách đây
mục cha
commit
e2144ed607

+ 1 - 1
pkg/cloud/awsprovider.go

@@ -2358,4 +2358,4 @@ func (a *AWS) ServiceAccountStatus() *ServiceAccountStatus {
 
 func (aws *AWS) CombinedDiscountForNode(instanceType string, isPreemptible bool, defaultDiscount, negotiatedDiscount float64) float64 {
 	return 1.0 - ((1.0 - defaultDiscount) * (1.0 - negotiatedDiscount))
-}
+}

+ 5 - 5
pkg/cloud/azureprovider.go

@@ -757,13 +757,13 @@ func (az *Azure) NodePricing(key Key) (*Node, error) {
 	if err != nil {
 		return nil, fmt.Errorf("No default pricing data available")
 	}
-	if azKey.isValidGPUNode()  {
+	if azKey.isValidGPUNode() {
 		return &Node{
-			VCPUCost: c.CPU,
-			RAMCost:  c.RAM,
+			VCPUCost:         c.CPU,
+			RAMCost:          c.RAM,
 			UsesBaseCPUPrice: true,
-			GPUCost:  c.GPU,
-			GPU:      azKey.GetGPUCount(),
+			GPUCost:          c.GPU,
+			GPU:              azKey.GetGPUCount(),
 		}, nil
 	}
 	return &Node{

+ 1 - 1
pkg/cloud/customprovider.go

@@ -311,4 +311,4 @@ func (cp *CustomProvider) PricingSourceStatus() map[string]*PricingSource {
 
 func (cp *CustomProvider) CombinedDiscountForNode(instanceType string, isPreemptible bool, defaultDiscount, negotiatedDiscount float64) float64 {
 	return 1.0 - ((1.0 - defaultDiscount) * (1.0 - negotiatedDiscount))
-}
+}

+ 1 - 7
pkg/cloud/provider.go

@@ -515,6 +515,7 @@ func ParseID(id string) string {
 	if len(match) >= 2 {
 		return match[1]
 	}
+
 	// gce://guestbook-227502/us-central1-a/gke-niko-n1-standard-2-wljla-8df8e58a-hfy7
 	//  => gke-niko-n1-standard-2-wljla-8df8e58a-hfy7
 	rx = regexp.MustCompile("gce://[^/]*/[^/]*/([^/]+)")
@@ -524,13 +525,9 @@ func ParseID(id string) string {
 	}
 
 	// Return id for Azure Provider, CSV Provider and Custom Provider
-
 	return id
-
-
 }
 
-
 // ParsePVID attempts to parse a PV ProviderId from a string based on formats from the various providers and
 // returns the string as is if it cannot find a match
 func ParsePVID(id string) string {
@@ -542,9 +539,7 @@ func ParsePVID(id string) string {
 	}
 
 	// Return id for GCP Provider, Azure Provider, CSV Provider and Custom Provider
-
 	return id
-
 }
 
 // ParseLBID attempts to parse a LB ProviderId from a string based on formats from the various providers and
@@ -559,4 +554,3 @@ func ParseLBID(id string) string {
 	// Return id for GCP Provider, Azure Provider, CSV Provider and Custom Provider
 	return id
 }
-

+ 3 - 1
pkg/kubecost/mock.go

@@ -4,8 +4,10 @@ import (
 	"fmt"
 	"time"
 )
+
 const gb = 1024 * 1024 * 1024
 const day = 24 * time.Hour
+
 var disk = PVKey{}
 
 // NewMockUnitAllocation creates an *Allocation with all of its float64 values set to 1 and generic properties if not provided in arg
@@ -304,7 +306,7 @@ func GenerateMockAllocationSet(start time.Time) *AllocationSet {
 }
 
 // GenerateMockAllocationSetWithAssetProperties with no idle and connections to Assets in properties
-func GenerateMockAllocationSetWithAssetProperties(start time.Time)  *AllocationSet {
+func GenerateMockAllocationSetWithAssetProperties(start time.Time) *AllocationSet {
 	as := GenerateMockAllocationSet(start)
 	disk1 := PVKey{
 		Cluster: "cluster2",