From 8b715255dbdde0c97768dde3f62d3cf5f5f73513 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Mon, 31 Jul 2023 10:53:46 +0200 Subject: [PATCH] Remove legacy OTLP HTTP port Signed-off-by: Pavol Loffay --- .chloggen/1954-remove-legacy-port.yaml | 16 ++++++++++++++++ pkg/collector/adapters/config_to_ports_test.go | 3 +-- pkg/collector/parser/receiver_otlp.go | 11 ++--------- pkg/collector/parser/receiver_otlp_test.go | 5 ++--- tests/e2e/ingress/00-assert.yaml | 7 ------- tests/e2e/managed-reconcile/00-assert.yaml | 10 ---------- tests/e2e/managed-reconcile/01-assert.yaml | 12 +----------- tests/e2e/managed-reconcile/02-assert.yaml | 12 +----------- tests/e2e/smoke-init-containers/00-assert.yaml | 10 ---------- tests/e2e/smoke-simplest/00-assert.yaml | 10 ---------- 10 files changed, 23 insertions(+), 73 deletions(-) create mode 100755 .chloggen/1954-remove-legacy-port.yaml diff --git a/.chloggen/1954-remove-legacy-port.yaml b/.chloggen/1954-remove-legacy-port.yaml new file mode 100755 index 0000000000..cfff1101fd --- /dev/null +++ b/.chloggen/1954-remove-legacy-port.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action) +component: operator + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove legacy OTLP HTTP port + +# One or more tracking issues related to the change +issues: [1954] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/pkg/collector/adapters/config_to_ports_test.go b/pkg/collector/adapters/config_to_ports_test.go index 09ead0cd86..307f1b84d7 100644 --- a/pkg/collector/adapters/config_to_ports_test.go +++ b/pkg/collector/adapters/config_to_ports_test.go @@ -85,7 +85,7 @@ func TestExtractPortsFromConfig(t *testing.T) { // test ports, err := adapters.ConfigToReceiverPorts(logger, config) assert.NoError(t, err) - assert.Len(t, ports, 11) + assert.Len(t, ports, 10) // verify httpAppProtocol := "http" @@ -104,7 +104,6 @@ func TestExtractPortsFromConfig(t *testing.T) { {Name: "otlp-2-grpc", AppProtocol: &grpcAppProtocol, Protocol: "TCP", Port: 55555}, {Name: "otlp-grpc", AppProtocol: &grpcAppProtocol, Port: 4317, TargetPort: targetPort4317}, {Name: "otlp-http", AppProtocol: &httpAppProtocol, Port: 4318, TargetPort: targetPort4318}, - {Name: "otlp-http-legacy", AppProtocol: &httpAppProtocol, Port: 55681, TargetPort: targetPort4318}, {Name: "zipkin", AppProtocol: &httpAppProtocol, Protocol: "TCP", Port: 9411}, } assert.ElementsMatch(t, expectedPorts, ports) diff --git a/pkg/collector/parser/receiver_otlp.go b/pkg/collector/parser/receiver_otlp.go index 2fa208fe94..a31d6c4afb 100644 --- a/pkg/collector/parser/receiver_otlp.go +++ b/pkg/collector/parser/receiver_otlp.go @@ -27,9 +27,8 @@ var _ ReceiverParser = &OTLPReceiverParser{} const ( parserNameOTLP = "__otlp" - defaultOTLPGRPCPort int32 = 4317 - defaultOTLPHTTPLegacyPort int32 = 55681 - defaultOTLPHTTPPort int32 = 4318 + defaultOTLPGRPCPort int32 = 4317 + defaultOTLPHTTPPort int32 = 4318 ) var ( @@ -88,12 +87,6 @@ func (o *OTLPReceiverParser) Ports() ([]corev1.ServicePort, error) { TargetPort: intstr.FromInt(int(defaultOTLPHTTPPort)), AppProtocol: &http, }, - { - Name: portName(fmt.Sprintf("%s-http-legacy", o.name), defaultOTLPHTTPLegacyPort), - Port: defaultOTLPHTTPLegacyPort, - TargetPort: intstr.FromInt(int(defaultOTLPHTTPPort)), // we target the official port, not the legacy - AppProtocol: &http, - }, }, }, } { diff --git a/pkg/collector/parser/receiver_otlp_test.go b/pkg/collector/parser/receiver_otlp_test.go index 6abca3b5d1..7d2ed16490 100644 --- a/pkg/collector/parser/receiver_otlp_test.go +++ b/pkg/collector/parser/receiver_otlp_test.go @@ -85,9 +85,8 @@ func TestOTLPExposeDefaultPorts(t *testing.T) { portNumber int32 seen bool }{ - "otlp-grpc": {portNumber: 4317}, - "otlp-http": {portNumber: 4318}, - "otlp-http-legacy": {portNumber: 55681}, + "otlp-grpc": {portNumber: 4317}, + "otlp-http": {portNumber: 4318}, } // test diff --git a/tests/e2e/ingress/00-assert.yaml b/tests/e2e/ingress/00-assert.yaml index 7d98dc4c40..7d779f6840 100644 --- a/tests/e2e/ingress/00-assert.yaml +++ b/tests/e2e/ingress/00-assert.yaml @@ -38,10 +38,3 @@ spec: name: otlp-http path: /otlp-http pathType: Prefix - - backend: - service: - name: simplest-collector - port: - name: otlp-http-legac - path: /otlp-http-legacy - pathType: Prefix diff --git a/tests/e2e/managed-reconcile/00-assert.yaml b/tests/e2e/managed-reconcile/00-assert.yaml index 09a06184b0..2c6158305b 100644 --- a/tests/e2e/managed-reconcile/00-assert.yaml +++ b/tests/e2e/managed-reconcile/00-assert.yaml @@ -27,11 +27,6 @@ spec: port: 4318 protocol: TCP targetPort: 4318 - - appProtocol: http - name: otlp-http-legacy - port: 55681 - protocol: TCP - targetPort: 4318 --- @@ -51,8 +46,3 @@ spec: port: 4318 protocol: TCP targetPort: 4318 - - appProtocol: http - name: otlp-http-legacy - port: 55681 - protocol: TCP - targetPort: 4318 diff --git a/tests/e2e/managed-reconcile/01-assert.yaml b/tests/e2e/managed-reconcile/01-assert.yaml index 17c266852e..3990db3b23 100644 --- a/tests/e2e/managed-reconcile/01-assert.yaml +++ b/tests/e2e/managed-reconcile/01-assert.yaml @@ -23,11 +23,6 @@ spec: port: 4318 protocol: TCP targetPort: 4318 - - appProtocol: http - name: otlp-http-legacy - port: 55681 - protocol: TCP - targetPort: 4318 --- @@ -47,11 +42,6 @@ spec: port: 4318 protocol: TCP targetPort: 4318 - - appProtocol: http - name: otlp-http-legacy - port: 55681 - protocol: TCP - targetPort: 4318 --- @@ -79,4 +69,4 @@ data: traces: receivers: [jaeger, otlp] processors: [] - exporters: [logging] \ No newline at end of file + exporters: [logging] diff --git a/tests/e2e/managed-reconcile/02-assert.yaml b/tests/e2e/managed-reconcile/02-assert.yaml index 90da4e64f8..a45ac3ba63 100644 --- a/tests/e2e/managed-reconcile/02-assert.yaml +++ b/tests/e2e/managed-reconcile/02-assert.yaml @@ -27,11 +27,6 @@ spec: port: 4318 protocol: TCP targetPort: 4318 - - appProtocol: http - name: otlp-http-legacy - port: 55681 - protocol: TCP - targetPort: 4318 --- @@ -51,11 +46,6 @@ spec: port: 4318 protocol: TCP targetPort: 4318 - - appProtocol: http - name: otlp-http-legacy - port: 55681 - protocol: TCP - targetPort: 4318 --- @@ -80,4 +70,4 @@ data: traces: receivers: [otlp] processors: [] - exporters: [logging] \ No newline at end of file + exporters: [logging] diff --git a/tests/e2e/smoke-init-containers/00-assert.yaml b/tests/e2e/smoke-init-containers/00-assert.yaml index f3c1644864..3f00937815 100644 --- a/tests/e2e/smoke-init-containers/00-assert.yaml +++ b/tests/e2e/smoke-init-containers/00-assert.yaml @@ -33,11 +33,6 @@ spec: port: 4318 protocol: TCP targetPort: 4318 - - appProtocol: http - name: otlp-http-legacy - port: 55681 - protocol: TCP - targetPort: 4318 --- @@ -62,8 +57,3 @@ spec: port: 4318 protocol: TCP targetPort: 4318 - - appProtocol: http - name: otlp-http-legacy - port: 55681 - protocol: TCP - targetPort: 4318 diff --git a/tests/e2e/smoke-simplest/00-assert.yaml b/tests/e2e/smoke-simplest/00-assert.yaml index f19dd651af..17365cdacd 100644 --- a/tests/e2e/smoke-simplest/00-assert.yaml +++ b/tests/e2e/smoke-simplest/00-assert.yaml @@ -28,11 +28,6 @@ spec: port: 4318 protocol: TCP targetPort: 4318 - - appProtocol: http - name: otlp-http-legacy - port: 55681 - protocol: TCP - targetPort: 4318 --- @@ -57,8 +52,3 @@ spec: port: 4318 protocol: TCP targetPort: 4318 - - appProtocol: http - name: otlp-http-legacy - port: 55681 - protocol: TCP - targetPort: 4318