Skip to content

Commit 6780f08

Browse files
committed
Update Go to version 1.24.1, update base image to AL2023
1 parent b79db97 commit 6780f08

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.23.6
1+
1.24.1

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ IMG ?= public.ecr.aws/eks/aws-load-balancer-controller:v2.12.0
77
GOLANG_VERSION ?= $(shell cat .go-version)
88
BUILD_IMAGE ?= public.ecr.aws/docker/library/golang:$(GOLANG_VERSION)
99
# Image URL to use for base layer in Docker build
10-
BASE_IMAGE ?= public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2024-08-13-1723575672.2
10+
BASE_IMAGE ?= public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2025-01-01-1735689705.2023
1111
IMG_PLATFORM ?= linux/amd64,linux/arm64
1212
# ECR doesn't appear to support SPDX SBOM
1313
IMG_SBOM ?= none

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module sigs.k8s.io/aws-load-balancer-controller
22

3-
go 1.23.6
3+
go 1.24.1
44

55
require (
66
github.com/aws/aws-sdk-go v1.55.5

pkg/networking/utils.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package networking
22

33
import (
4-
"fmt"
4+
"net/netip"
5+
"strings"
6+
57
awssdk "github.com/aws/aws-sdk-go-v2/aws"
68
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
79
"github.com/pkg/errors"
8-
"net/netip"
910
elbv2model "sigs.k8s.io/aws-load-balancer-controller/pkg/model/elbv2"
10-
"strings"
1111
)
1212

1313
// ParseCIDRs will parse CIDRs in string format into parsed IPPrefix
@@ -80,30 +80,30 @@ func GetSubnetAssociatedIPv6CIDRs(subnet ec2types.Subnet) ([]netip.Prefix, error
8080
// ValidateEnablePrefixForIpv6SourceNat function returns the validation error if error exists for EnablePrefixForIpv6SourceNat annotation value
8181
func ValidateEnablePrefixForIpv6SourceNat(EnablePrefixForIpv6SourceNat string, ipAddressType elbv2model.IPAddressType, ec2Subnets []ec2types.Subnet) error {
8282
if EnablePrefixForIpv6SourceNat != string(elbv2model.EnablePrefixForIpv6SourceNatOn) && EnablePrefixForIpv6SourceNat != string(elbv2model.EnablePrefixForIpv6SourceNatOff) {
83-
return errors.Errorf(fmt.Sprintf("Invalid enable-prefix-for-ipv6-source-nat value: %v. Valid values are ['on', 'off'].", EnablePrefixForIpv6SourceNat))
83+
return errors.Errorf("Invalid enable-prefix-for-ipv6-source-nat value: %v. Valid values are ['on', 'off'].", EnablePrefixForIpv6SourceNat)
8484
}
8585

8686
if EnablePrefixForIpv6SourceNat != string(elbv2model.EnablePrefixForIpv6SourceNatOn) {
8787
return nil
8888
}
8989

9090
if ipAddressType == elbv2model.IPAddressTypeIPV4 {
91-
return errors.Errorf(fmt.Sprintf("enable-prefix-for-ipv6-source-nat annotation is only applicable to Network Load Balancers using Dualstack IP address type."))
91+
return errors.Errorf("enable-prefix-for-ipv6-source-nat annotation is only applicable to Network Load Balancers using Dualstack IP address type.")
9292
}
9393
var subnetsWithoutIPv6CIDR []string
9494

9595
for _, subnet := range ec2Subnets {
9696
subnetIPv6CIDRs, err := GetSubnetAssociatedIPv6CIDRs(subnet)
9797
if err != nil {
98-
return errors.Errorf(fmt.Sprintf("%v", err))
98+
return errors.Errorf("%v", err)
9999
}
100100
if len(subnetIPv6CIDRs) < 1 {
101101
subnetsWithoutIPv6CIDR = append(subnetsWithoutIPv6CIDR, awssdk.ToString(subnet.SubnetId))
102102

103103
}
104104
}
105105
if len(subnetsWithoutIPv6CIDR) > 0 {
106-
return errors.Errorf(fmt.Sprintf("To enable prefix for source NAT, all associated subnets must have an IPv6 CIDR. Subnets without IPv6 CIDR: %v.", subnetsWithoutIPv6CIDR))
106+
return errors.Errorf("To enable prefix for source NAT, all associated subnets must have an IPv6 CIDR. Subnets without IPv6 CIDR: %v.", subnetsWithoutIPv6CIDR)
107107
}
108108

109109
return nil
@@ -120,36 +120,36 @@ func ValidateSourceNatPrefixes(sourceNatIpv6Prefixes []string, ipAddressType elb
120120
}
121121

122122
if len(sourceNatIpv6Prefixes) != len(ec2Subnets) {
123-
return errors.Errorf(fmt.Sprintf("Number of values in source-nat-ipv6-prefixes (%d) must match the number of subnets (%d).", len(sourceNatIpv6Prefixes), len(ec2Subnets)))
123+
return errors.Errorf("Number of values in source-nat-ipv6-prefixes (%d) must match the number of subnets (%d).", len(sourceNatIpv6Prefixes), len(ec2Subnets))
124124
}
125125
for idx, sourceNatIpv6Prefix := range sourceNatIpv6Prefixes {
126126
var subnet = ec2Subnets[idx]
127127
var sourceNatIpv6PrefixParsedList []netip.Addr
128128
if sourceNatIpv6Prefix != elbv2model.SourceNatIpv6PrefixAutoAssigned {
129129
subStrings := strings.Split(sourceNatIpv6Prefix, "/")
130130
if len(subStrings) < 2 {
131-
return errors.Errorf(fmt.Sprintf("Invalid value in source-nat-ipv6-prefixes: %v.", sourceNatIpv6Prefix))
131+
return errors.Errorf("Invalid value in source-nat-ipv6-prefixes: %v.", sourceNatIpv6Prefix)
132132
}
133133
var ipAddressPart = subStrings[0]
134134
var prefixLengthPart = subStrings[1]
135135
if prefixLengthPart != requiredPrefixLengthForSourceNatCidr {
136-
return errors.Errorf(fmt.Sprintf("Invalid value in source-nat-ipv6-prefixes: %v. Prefix length must be %v, but %v is specified.", sourceNatIpv6Prefix, requiredPrefixLengthForSourceNatCidr, prefixLengthPart))
136+
return errors.Errorf("Invalid value in source-nat-ipv6-prefixes: %v. Prefix length must be %v, but %v is specified.", sourceNatIpv6Prefix, requiredPrefixLengthForSourceNatCidr, prefixLengthPart)
137137
}
138138
sourceNatIpv6PrefixNetIpParsed, err := netip.ParseAddr(ipAddressPart)
139139
if err != nil {
140-
return errors.Errorf(fmt.Sprintf("Invalid value in source-nat-ipv6-prefixes: %v. Value must be a valid IPv6 CIDR.", sourceNatIpv6Prefix))
140+
return errors.Errorf("Invalid value in source-nat-ipv6-prefixes: %v. Value must be a valid IPv6 CIDR.", sourceNatIpv6Prefix)
141141
}
142142
sourceNatIpv6PrefixParsedList = append(sourceNatIpv6PrefixParsedList, sourceNatIpv6PrefixNetIpParsed)
143143
if !sourceNatIpv6PrefixNetIpParsed.Is6() {
144-
return errors.Errorf(fmt.Sprintf("Invalid value in source-nat-ipv6-prefixes: %v. Value must be a valid IPv6 CIDR.", sourceNatIpv6Prefix))
144+
return errors.Errorf("Invalid value in source-nat-ipv6-prefixes: %v. Value must be a valid IPv6 CIDR.", sourceNatIpv6Prefix)
145145
}
146146
subnetIPv6CIDRs, err := GetSubnetAssociatedIPv6CIDRs(subnet)
147147
if err != nil {
148-
return errors.Errorf(fmt.Sprintf("Subnet has invalid IPv6 CIDRs: %v. Subnet must have valid IPv6 CIDRs.", subnetIPv6CIDRs))
148+
return errors.Errorf("Subnet has invalid IPv6 CIDRs: %v. Subnet must have valid IPv6 CIDRs.", subnetIPv6CIDRs)
149149
}
150150
sourceNatIpv6PrefixWithinSubnet := FilterIPsWithinCIDRs(sourceNatIpv6PrefixParsedList, subnetIPv6CIDRs)
151151
if len(sourceNatIpv6PrefixWithinSubnet) != 1 {
152-
return errors.Errorf(fmt.Sprintf("Invalid value in source-nat-ipv6-prefixes: %v. Value must be within subnet CIDR range: %v.", sourceNatIpv6Prefix, subnetIPv6CIDRs))
152+
return errors.Errorf("Invalid value in source-nat-ipv6-prefixes: %v. Value must be within subnet CIDR range: %v.", sourceNatIpv6Prefix, subnetIPv6CIDRs)
153153
}
154154
}
155155
}

0 commit comments

Comments
 (0)