Skip to content

Commit a3cad91

Browse files
Challa ReddyHarness
authored andcommitted
fix: [CCM-32555]: fixed the instanceType where parts can be upto 5 parts in length (#51)
* 318444 fix: [CCM-32555]: fixed the instanceType where parts can be upto 5 parts in length
1 parent e323c01 commit a3cad91

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

internal/cloudinfo/providers/google/instancefamily_mapper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
func (g *GceInfoer) mapSeries(instanceType string) string {
2626
instanceTypeParts := strings.Split(instanceType, "-")
2727

28-
if len(instanceTypeParts) >= 2 && len(instanceTypeParts) <= 4 {
28+
if len(instanceTypeParts) >= 2 && len(instanceTypeParts) <= 5 {
2929
return instanceTypeParts[0]
3030
}
3131

internal/cloudinfo/providers/google/instancefamily_mapper_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ import (
2525

2626
func TestGoogleInfoer_mapSeries(t *testing.T) {
2727
familySeriesMap := map[string]string{
28-
"n2-highmem-2": "n2",
29-
"e2-micro": "e2",
30-
"n2d-standard-8": "n2d",
31-
"c4a-highmem-8-lssd": "c4a",
32-
"unidentifiedType": "unidentifiedType",
28+
"n2-highmem-2": "n2",
29+
"e2-micro": "e2",
30+
"n2d-standard-8": "n2d",
31+
"c4a-highmem-8-lssd": "c4a",
32+
"c4-highmem-288-lssd-metal": "c4",
33+
"unidentifiedType": "unidentifiedType",
3334
}
3435

3536
gceInfoer := GceInfoer{log: cloudinfoadapter.NewLogger(&logur.TestLogger{})}

0 commit comments

Comments
 (0)