From 7f83b5da7dddf4ed914933de8b308095896fd191 Mon Sep 17 00:00:00 2001 From: Saed SayedAhmed <34514167+saedx1@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:26:31 -0500 Subject: [PATCH 1/3] Hotfix: port numbers not fitting in an int16 The ideal solution would be to use uint16, however, that will require a bigger amount of change to adjust all types. Int32 should so. Signed-off-by: Saed SayedAhmed <34514167+saedx1@users.noreply.github.com> --- internal/configs/parsing_helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/configs/parsing_helpers.go b/internal/configs/parsing_helpers.go index 5c31a5b1d8..b66c2f4f95 100644 --- a/internal/configs/parsing_helpers.go +++ b/internal/configs/parsing_helpers.go @@ -306,7 +306,7 @@ func ParsePortList(s string) ([]int, error) { } func parsePort(value string) (int, error) { - port, err := strconv.ParseInt(value, 10, 16) + port, err := strconv.ParseInt(value, 10, 32) if err != nil { return 0, fmt.Errorf("unable to parse port as integer: %w", err) } From 1884d70d99f9d6899bacb63cfa5b03172531b429 Mon Sep 17 00:00:00 2001 From: Saed SayedAhmed <34514167+saedx1@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:30:50 -0500 Subject: [PATCH 2/3] Add a test that fails on the current code Signed-off-by: Saed SayedAhmed <34514167+saedx1@users.noreply.github.com> --- internal/k8s/validation_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/k8s/validation_test.go b/internal/k8s/validation_test.go index 9ad4378968..30116cc275 100644 --- a/internal/k8s/validation_test.go +++ b/internal/k8s/validation_test.go @@ -2014,7 +2014,7 @@ func TestValidateNginxIngressAnnotations(t *testing.T) { { annotations: map[string]string{ - "nginx.org/listen-ports": "80,8080,9090", + "nginx.org/listen-ports": "80,8080,9090,44313", }, specServices: map[string]bool{}, isPlus: false, From 48ea40bdfcfca79bed4e4cccc234dcd563598d69 Mon Sep 17 00:00:00 2001 From: Saed SayedAhmed <34514167+saedx1@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:36:05 -0500 Subject: [PATCH 3/3] Add another test for ssl ports Signed-off-by: Saed SayedAhmed <34514167+saedx1@users.noreply.github.com> --- internal/k8s/validation_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/k8s/validation_test.go b/internal/k8s/validation_test.go index 30116cc275..ed71883af5 100644 --- a/internal/k8s/validation_test.go +++ b/internal/k8s/validation_test.go @@ -2041,7 +2041,7 @@ func TestValidateNginxIngressAnnotations(t *testing.T) { { annotations: map[string]string{ - "nginx.org/listen-ports-ssl": "443,8443", + "nginx.org/listen-ports-ssl": "443,8443,44315", }, specServices: map[string]bool{}, isPlus: false,