Explorar o código

Merge branch 'develop' into kaelan-fix-node-vgpu-count

Kaelan Patel %!s(int64=3) %!d(string=hai) anos
pai
achega
5eac9539f0

+ 5 - 5
.circleci/config.yml

@@ -1,13 +1,13 @@
 version: 2
-jobs:                 
+jobs:
   build:
     machine: true
     steps:
       - checkout
-      - run: | 
+      - run: |
           TAG=0.1.$CIRCLE_BUILD_NUM
           docker login -u $DOCKER_USER -p $DOCKER_PASS
-          docker build -t ajaytripathy/kubecost-cost-model:$TAG .
+          docker buildx build -t ajaytripathy/kubecost-cost-model:$TAG .
           docker push ajaytripathy/kubecost-cost-model:$TAG
   deploy:
     machine: true
@@ -15,7 +15,7 @@ jobs:
       - checkout
       - run: |
           docker login -u $DOCKER_USER -p $DOCKER_PASS
-          docker build -t ajaytripathy/kubecost-cost-model:latest .
+          docker buildx build -t ajaytripathy/kubecost-cost-model:latest .
           docker push ajaytripathy/kubecost-cost-model:latest
 
 workflows:
@@ -24,7 +24,7 @@ workflows:
     jobs:
       - build
       - deploy:
-          requires: 
+          requires:
             - build
           filters:
             branches:

+ 2 - 0
pkg/cloud/gcpprovider.go

@@ -1448,6 +1448,8 @@ func parseGCPInstanceTypeLabel(it string) string {
 			instanceType = "n2standard"
 		} else if instanceType == "e2highmem" || instanceType == "e2highcpu" {
 			instanceType = "e2standard"
+		} else if instanceType == "n2dhighmem" || instanceType == "n2dhighcpu" {
+			instanceType = "n2dstandard"
 		} else if strings.HasPrefix(instanceType, "custom") {
 			instanceType = "custom" // The suffix of custom does not matter
 		}

+ 4 - 0
pkg/cloud/gcpprovider_test.go

@@ -25,6 +25,10 @@ func TestParseGCPInstanceTypeLabel(t *testing.T) {
 			input:    "custom-n1-standard-2",
 			expected: "custom",
 		},
+		{
+			input:    "n2d-highmem-8",
+			expected: "n2dstandard",
+		},
 	}
 
 	for _, test := range cases {

+ 1 - 1
pkg/kubecost/allocation_json.go

@@ -64,7 +64,7 @@ func (aj *AllocationJSON) BuildFromAllocation(a *Allocation) {
 	aj.Window = a.Window
 	aj.Start = a.Start.UTC().Format(time.RFC3339)
 	aj.End = a.End.UTC().Format(time.RFC3339)
-	aj.Minutes = formatFloat64ForResponse(a.Minutes())
+  aj.Minutes = formatFloat64ForResponse(a.Minutes())
 	aj.CPUCores = formatFloat64ForResponse(a.CPUCores())
 	aj.CPUCoreRequestAverage = formatFloat64ForResponse(a.CPUCoreRequestAverage)
 	aj.CPUCoreUsageAverage = formatFloat64ForResponse(a.CPUCoreUsageAverage)

BIN=BIN
ui/src/images/favicon.ico


+ 10 - 9
ui/src/index.html

@@ -1,12 +1,13 @@
 <!DOCTYPE html>
 <html>
-    <head>
-        <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
-        <meta content="utf-8" http-equiv="encoding">
-        <link rel="stylesheet" href="./css/index.css">
-    </head>
-    <body>
-        <div id="app" class="page-container"></div>
-        <script src="./app.js" type="module"></script>
-    </body>
+	<head>
+		<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
+		<meta content="utf-8" http-equiv="encoding" />
+		<link rel="icon" href="./images/favicon.ico" />
+		<link rel="stylesheet" href="./css/index.css" />
+	</head>
+	<body>
+		<div id="app" class="page-container"></div>
+		<script src="./app.js" type="module"></script>
+	</body>
 </html>