Skip to content

Commit d80c693

Browse files
authored
Merge pull request #4 from elotl/selvik/fixzeroprice
Add handling of new GCP families c4d, m4 and a4
2 parents 4bbab43 + aa95a66 commit d80c693

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Cache Go module dependencies
3131
id: cache-go-module-dependencies
32-
uses: actions/cache@v2
32+
uses: actions/cache@v3
3333
with:
3434
path: ~/go/pkg/mod
3535
key: go-mod-cache-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('go.sum') }}
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Cache licenses
4646
id: cache-licenses
47-
uses: actions/cache@v2
47+
uses: actions/cache@v3
4848
with:
4949
path: .licensei.cache
5050
key: licensei-v1-${{ steps.set-git-refname.outputs.git_refname }}-${{ hashFiles('go.sum') }}
@@ -89,7 +89,7 @@ jobs:
8989

9090
- name: Cache Go module dependencies
9191
id: cache-go-module-dependencies
92-
uses: actions/cache@v2
92+
uses: actions/cache@v3
9393
with:
9494
path: ~/go/pkg/mod
9595
key: go-mod-cache-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('go.sum') }}
@@ -116,7 +116,7 @@ jobs:
116116

117117
- name: Restore Go module dependencies cache
118118
id: cache-go-module-dependencies
119-
uses: actions/cache@v2
119+
uses: actions/cache@v3
120120
with:
121121
path: ~/go/pkg/mod
122122
key: go-mod-cache-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('go.sum') }}
@@ -143,7 +143,7 @@ jobs:
143143

144144
- name: Restore Go module dependencies cache
145145
id: cache-go-module-dependencies
146-
uses: actions/cache@v2
146+
uses: actions/cache@v3
147147
with:
148148
path: ~/go/pkg/mod
149149
key: go-mod-cache-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('go.sum') }}

internal/cloudinfo/providers/google/cloudinfo.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ import (
3838
const svcGke = "gke"
3939

4040
var regionNames = map[string]string{
41-
"asia-east1": "Asia Pacific (Taiwan)",
42-
"asia-east2": "Asia Pacific (Hong Kong)",
43-
"asia-northeast1": "Asia Pacific (Tokyo)",
44-
"asia-northeast2": "Asia Pacific (Osaka)",
45-
"asia-northeast3": "Asia Pacific (Seoul)",
46-
"asia-south1": "Asia Pacific (Mumbai)",
47-
"asia-south2": "Asia Pacific (Delhi)",
48-
"asia-southeast1": "Asia Pacific (Singapore)",
49-
"asia-southeast2": "Asia Pacific (Jakarta)",
41+
"asia-east1": "Asia Pacific (Taiwan)",
42+
"asia-east2": "Asia Pacific (Hong Kong)",
43+
"asia-northeast1": "Asia Pacific (Tokyo)",
44+
"asia-northeast2": "Asia Pacific (Osaka)",
45+
"asia-northeast3": "Asia Pacific (Seoul)",
46+
"asia-south1": "Asia Pacific (Mumbai)",
47+
"asia-south2": "Asia Pacific (Delhi)",
48+
"asia-southeast1": "Asia Pacific (Singapore)",
49+
"asia-southeast2": "Asia Pacific (Jakarta)",
5050

5151
"australia-southeast1": "Asia Pacific (Sydney)",
5252
"australia-southeast2": "Asia Pacific (Melbourne)",
@@ -257,7 +257,8 @@ func (g *GceInfoer) Initialize() (map[string]map[string]types.Price, error) {
257257
func isSupportedFamily(family string) bool {
258258
return family == "a2" || family == "a3" || family == "c3" || family == "c3d" || family == "c4" ||
259259
family == "e2" || family == "g2" || family == "h3" || family == "n2" || family == "n4" || family == "m3" ||
260-
family == "c4a" || family == "t2a" || family == "n2d" || family == "c2d" || family == "t2d" || family == "z3"
260+
family == "c4a" || family == "t2a" || family == "n2d" || family == "c2d" || family == "t2d" || family == "z3" ||
261+
family == "c4d" || family == "m4" || family == "a4"
261262
}
262263

263264
func (g *GceInfoer) getPrice() (map[string]map[string]map[string]float64, error) {
@@ -331,7 +332,7 @@ func (g *GceInfoer) getPrice() (map[string]map[string]map[string]float64, error)
331332
}
332333
resMatch := (descSplit[1] == "Instance" && (descSplit[2] == "Ram" || descSplit[2] == "Core")) ||
333334
(descSplit[2] == "Instance" && (descSplit[3] == "Ram" || descSplit[3] == "Core") &&
334-
(descSplit[1] == "Memory-optimized" || descSplit[1] == "Arm" || descSplit[1] == "AMD"))
335+
(descSplit[1] == "Memory-optimized" || descSplit[1] == "Arm" || descSplit[1] == "AMD"))
335336
if !resMatch {
336337
continue
337338
}

0 commit comments

Comments
 (0)