Skip to content

Commit f588dcf

Browse files
Refactor listener naming to standardize HTTP and HTTP2 prefixes
1 parent e7d91e4 commit f588dcf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pkg/cloudprovider/providers/oci/load_balancer_spec_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8964,8 +8964,8 @@ func Test_getListeners(t *testing.T) {
89648964
listenerBackendIpVersion: []string{IPv4},
89658965
sslConfig: nil,
89668966
want: map[string]client.GenericListener{
8967-
"HTTP2-443": {
8968-
Name: common.String("HTTP2-443"),
8967+
"HTTP-443": {
8968+
Name: common.String("HTTP-443"),
89698969
Port: common.Int(443),
89708970
Protocol: common.String("HTTP2"),
89718971
DefaultBackendSetName: common.String("TCP-443"),

pkg/cloudprovider/providers/oci/load_balancer_util.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,10 @@ func getSanitizedName(name string) string {
679679
}
680680

681681
func getListenerName(protocol string, port int) string {
682+
// For HTTP and HTTP2 protocols, always use "HTTP" prefix
683+
if strings.EqualFold(protocol, "HTTP") || strings.EqualFold(protocol, "HTTP2") {
684+
return fmt.Sprintf("HTTP-%d", port)
685+
}
682686
return fmt.Sprintf("%s-%d", protocol, port)
683687
}
684688

0 commit comments

Comments
 (0)