Skip to content

Commit 935ca9d

Browse files
authored
merge(#965): added EKS 1.24, removed EKS 1.19-20 support
2 parents 8a2aaf4 + bca9c7a commit 935ca9d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

internal/cloudinfo/providers/amazon/cloudinfo.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func (e *Ec2Infoer) GetVirtualMachines(region string) ([]types.VMInfo, error) {
173173
missingAttributes[instanceType] = append(missingAttributes[instanceType], "networkPerformance")
174174
}
175175

176-
var currGen = true
176+
currGen := true
177177
if currentGenStr, err := pd.getDataForKey("currentGeneration"); err == nil {
178178
if strings.ToLower(currentGenStr) == "no" {
179179
currGen = false
@@ -219,7 +219,7 @@ func (e *Ec2Infoer) GetVirtualMachines(region string) ([]types.VMInfo, error) {
219219
// GetProducts retrieves the available virtual machines based on the arguments provided
220220
// Delegates to the underlying PricingSource instance and performs transformations
221221
func (e *Ec2Infoer) GetProducts(vms []types.VMInfo, service, regionId string) ([]types.VMInfo, error) {
222-
var vmList = vms
222+
vmList := vms
223223
if len(vmList) == 0 {
224224
var err error
225225
vmList, err = e.GetVirtualMachines(regionId)
@@ -266,6 +266,7 @@ func newPriceData(prData aws.JSONValue) (*priceData, error) {
266266

267267
return &pd, nil
268268
}
269+
269270
func (pd *priceData) getDataForKey(attr string) (string, error) {
270271
if value, ok := pd.attrMap[attr].(string); ok {
271272
return value, nil
@@ -553,7 +554,7 @@ func (e *Ec2Infoer) GetServiceImages(service, region string) ([]types.Image, err
553554
serviceImages := make([]types.Image, 0)
554555
switch service {
555556
case svcEks:
556-
for _, k8sVersion := range []string{"1.19", "1.20", "1.21", "1.22", "1.23"} {
557+
for _, k8sVersion := range []string{"1.21", "1.22", "1.23", "1.24"} {
557558
gpuImages, err := e.ec2Describer(region).DescribeImages(getEKSDescribeImagesInput(k8sVersion, true))
558559
if err != nil {
559560
return nil, err
@@ -617,7 +618,7 @@ func (e *Ec2Infoer) GetServiceProducts(region, service string) ([]types.ProductD
617618
func (e *Ec2Infoer) GetVersions(service, region string) ([]types.LocationVersion, error) {
618619
switch service {
619620
case svcEks:
620-
return []types.LocationVersion{types.NewLocationVersion(region, []string{"1.19.16", "1.20.15", "1.21.13", "1.22.10", "1.23.7"}, "1.22.10")}, nil
621+
return []types.LocationVersion{types.NewLocationVersion(region, []string{"1.21.14", "1.22.15", "1.23.13", "1.24.7"}, "1.23.13")}, nil
621622
default:
622623
return []types.LocationVersion{}, nil
623624
}
@@ -635,7 +636,7 @@ func getImageCreateDate(image *ec2.Image) (time.Time, error) {
635636
// getLatestImage iterates through the image list and returns the one with the latest CreationDate
636637
func getLatestImage(images []*ec2.Image) (*ec2.Image, error) {
637638
var latestImage *ec2.Image
638-
var latestImageCreationDate = time.Time{}
639+
latestImageCreationDate := time.Time{}
639640

640641
for _, image := range images {
641642
imgCreateDate, err := getImageCreateDate(image)

0 commit comments

Comments
 (0)