@@ -29,7 +29,6 @@ const (
29
29
)
30
30
31
31
var (
32
- amdRegex = regexp .MustCompile (`[a-zA-Z0-9]+a\\.[a-zA-Z0-9]` )
33
32
networkPerfRE = regexp .MustCompile (`[0-9]+ Gigabit` )
34
33
generationRE = regexp .MustCompile (`[a-zA-Z]+([0-9]+)` )
35
34
)
@@ -41,7 +40,7 @@ func isSupportedFromString(instanceTypeValue *string, target *string) bool {
41
40
if instanceTypeValue == nil {
42
41
return false
43
42
}
44
- return * instanceTypeValue == * target
43
+ return strings . EqualFold ( * instanceTypeValue , * target )
45
44
}
46
45
47
46
func isSupportedFromStrings (instanceTypeValues []* string , target * string ) bool {
@@ -83,7 +82,7 @@ func isSupportedUsageClassType(instanceTypeValue []ec2types.UsageClassType, targ
83
82
}
84
83
85
84
for _ , potentialType := range instanceTypeValue {
86
- if potentialType == * target {
85
+ if strings . EqualFold ( string ( potentialType ), string ( * target )) {
87
86
return true
88
87
}
89
88
}
@@ -102,7 +101,7 @@ func isSupportedArchitectureType(instanceTypeValue []ec2types.ArchitectureType,
102
101
}
103
102
104
103
for _ , potentialType := range instanceTypeValue {
105
- if potentialType == * target {
104
+ if strings . EqualFold ( string ( potentialType ), string ( * target )) {
106
105
return true
107
106
}
108
107
}
@@ -120,7 +119,7 @@ func isSupportedVirtualizationType(instanceTypeValue []ec2types.VirtualizationTy
120
119
return true
121
120
}
122
121
for _ , potentialType := range instanceTypeValue {
123
- if potentialType == * target {
122
+ if strings . EqualFold ( string ( potentialType ), string ( * target )) {
124
123
return true
125
124
}
126
125
}
@@ -134,7 +133,7 @@ func isSupportedInstanceTypeHypervisorType(instanceTypeValue ec2types.InstanceTy
134
133
if reflect .ValueOf (* target ).IsZero () {
135
134
return true
136
135
}
137
- if instanceTypeValue == * target {
136
+ if strings . EqualFold ( string ( instanceTypeValue ), string ( * target )) {
138
137
return true
139
138
}
140
139
return false
@@ -151,7 +150,7 @@ func isSupportedRootDeviceType(instanceTypeValue []ec2types.RootDeviceType, targ
151
150
return true
152
151
}
153
152
for _ , potentialType := range instanceTypeValue {
154
- if potentialType == * target {
153
+ if strings . EqualFold ( string ( potentialType ), string ( * target )) {
155
154
return true
156
155
}
157
156
}
@@ -165,7 +164,7 @@ func isMatchingCpuArchitecture(instanceTypeValue CPUManufacturer, target *CPUMan
165
164
if reflect .ValueOf (* target ).IsZero () {
166
165
return true
167
166
}
168
- if instanceTypeValue == * target {
167
+ if strings . EqualFold ( string ( instanceTypeValue ), string ( * target )) {
169
168
return true
170
169
}
171
170
return false
@@ -376,19 +375,6 @@ func getEBSOptimizedBaselineIOPS(ebsInfo *ec2types.EbsInfo) *int32 {
376
375
return ebsInfo .EbsOptimizedInfo .BaselineIops
377
376
}
378
377
379
- func getCPUManufacturer (instanceTypeInfo * ec2types.InstanceTypeInfo ) CPUManufacturer {
380
- for _ , it := range instanceTypeInfo .ProcessorInfo .SupportedArchitectures {
381
- if it == ec2types .ArchitectureTypeArm64 {
382
- return CPUManufacturerAWS
383
- }
384
- }
385
-
386
- if amdRegex .Match ([]byte (instanceTypeInfo .InstanceType )) {
387
- return CPUManufacturerAMD
388
- }
389
- return CPUManufacturerIntel
390
- }
391
-
392
378
// getInstanceTypeGeneration returns the generation from an instance type name
393
379
// i.e. c7i.xlarge -> 7
394
380
// if any error occurs, 0 will be returned.
0 commit comments