Skip to content

Commit

Permalink
Merge pull request #3938 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…3932-to-release-1.27

[release-1.27] [IPv6] backend pool name should be case-insensitive
  • Loading branch information
k8s-ci-robot committed May 22, 2023
2 parents 464d29b + 45f8b80 commit 2d33493
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/provider/azure_standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ const (
v6Suffix = "IPv6"
)

var (
v6SuffixLower = strings.ToLower(v6Suffix)
)

// returns the full identifier of an availabilitySet
func (az *Cloud) getAvailabilitySetID(resourceGroup, availabilitySetName string) string {
return fmt.Sprintf(
Expand Down Expand Up @@ -276,7 +280,7 @@ func getBackendPoolName(clusterName string, isIPv6 bool) string {

// ifBackendPoolIPv6 checks if a backend pool is of IPv6 according to name/ID.
func isBackendPoolIPv6(name string) bool {
return strings.HasSuffix(name, fmt.Sprintf("-%s", v6Suffix))
return strings.HasSuffix(strings.ToLower(name), fmt.Sprintf("-%s", v6SuffixLower))
}

func (az *Cloud) getLoadBalancerRuleName(service *v1.Service, protocol v1.Protocol, port int32, isIPv6 bool) string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/azure_standard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ func TestIsBackendPoolIPv6(t *testing.T) {
{"bp-IPv6", true},
{"bp-IPv4", false},
{"bp", false},
{"bp-ipv6", false},
{"bp-ipv6", true},
}
for _, test := range testcases {
isIPv6 := isBackendPoolIPv6(test.name)
Expand Down

0 comments on commit 2d33493

Please sign in to comment.