@@ -29,7 +29,6 @@ const (
2929)
3030
3131var (
32- amdRegex = regexp .MustCompile (`[a-zA-Z0-9]+a\\.[a-zA-Z0-9]` )
3332 networkPerfRE = regexp .MustCompile (`[0-9]+ Gigabit` )
3433 generationRE = regexp .MustCompile (`[a-zA-Z]+([0-9]+)` )
3534)
@@ -41,7 +40,7 @@ func isSupportedFromString(instanceTypeValue *string, target *string) bool {
4140 if instanceTypeValue == nil {
4241 return false
4342 }
44- return * instanceTypeValue == * target
43+ return strings . EqualFold ( * instanceTypeValue , * target )
4544}
4645
4746func isSupportedFromStrings (instanceTypeValues []* string , target * string ) bool {
@@ -83,7 +82,7 @@ func isSupportedUsageClassType(instanceTypeValue []ec2types.UsageClassType, targ
8382 }
8483
8584 for _ , potentialType := range instanceTypeValue {
86- if potentialType == * target {
85+ if strings . EqualFold ( string ( potentialType ), string ( * target )) {
8786 return true
8887 }
8988 }
@@ -102,7 +101,7 @@ func isSupportedArchitectureType(instanceTypeValue []ec2types.ArchitectureType,
102101 }
103102
104103 for _ , potentialType := range instanceTypeValue {
105- if potentialType == * target {
104+ if strings . EqualFold ( string ( potentialType ), string ( * target )) {
106105 return true
107106 }
108107 }
@@ -120,7 +119,7 @@ func isSupportedVirtualizationType(instanceTypeValue []ec2types.VirtualizationTy
120119 return true
121120 }
122121 for _ , potentialType := range instanceTypeValue {
123- if potentialType == * target {
122+ if strings . EqualFold ( string ( potentialType ), string ( * target )) {
124123 return true
125124 }
126125 }
@@ -134,7 +133,7 @@ func isSupportedInstanceTypeHypervisorType(instanceTypeValue ec2types.InstanceTy
134133 if reflect .ValueOf (* target ).IsZero () {
135134 return true
136135 }
137- if instanceTypeValue == * target {
136+ if strings . EqualFold ( string ( instanceTypeValue ), string ( * target )) {
138137 return true
139138 }
140139 return false
@@ -151,7 +150,7 @@ func isSupportedRootDeviceType(instanceTypeValue []ec2types.RootDeviceType, targ
151150 return true
152151 }
153152 for _ , potentialType := range instanceTypeValue {
154- if potentialType == * target {
153+ if strings . EqualFold ( string ( potentialType ), string ( * target )) {
155154 return true
156155 }
157156 }
@@ -165,7 +164,7 @@ func isMatchingCpuArchitecture(instanceTypeValue CPUManufacturer, target *CPUMan
165164 if reflect .ValueOf (* target ).IsZero () {
166165 return true
167166 }
168- if instanceTypeValue == * target {
167+ if strings . EqualFold ( string ( instanceTypeValue ), string ( * target )) {
169168 return true
170169 }
171170 return false
@@ -376,19 +375,6 @@ func getEBSOptimizedBaselineIOPS(ebsInfo *ec2types.EbsInfo) *int32 {
376375 return ebsInfo .EbsOptimizedInfo .BaselineIops
377376}
378377
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-
392378// getInstanceTypeGeneration returns the generation from an instance type name
393379// i.e. c7i.xlarge -> 7
394380// if any error occurs, 0 will be returned.
0 commit comments