Skip to content

Commit 7670888

Browse files
authored
Merge pull request kubernetes-sigs#2516 from olemarkus/sanitise-cluster-name
Make e2e LB name test work with clusters that have . in the name
2 parents d9b4c5f + 7330bd1 commit 7670888

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/e2e/ingress/vanilla_ingress_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"net/http"
7+
"strings"
78
"time"
89

910
awssdk "github.com/aws/aws-sdk-go/aws"
@@ -237,7 +238,8 @@ var _ = Describe("vanilla ingress tests", func() {
237238
},
238239
},
239240
}
240-
lbName := fmt.Sprintf("%.16s-%.15s", tf.Options.ClusterName, sandboxNS.Name)
241+
safeClusterName := strings.ReplaceAll(tf.Options.ClusterName, ".", "-")
242+
lbName := fmt.Sprintf("%.16s-%.15s", safeClusterName, sandboxNS.Name)
241243
ing := ingBuilder.
242244
AddHTTPRoute("", networking.HTTPIngressPath{Path: "/path", PathType: &exact, Backend: ingBackend}).
243245
WithAnnotations(map[string]string{

0 commit comments

Comments
 (0)