Skip to content

Commit

Permalink
Remove legacy OTLP HTTP port
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
  • Loading branch information
pavolloffay committed Jul 31, 2023
1 parent 42ff92f commit 7124a96
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 41 deletions.
16 changes: 16 additions & 0 deletions .chloggen/1954-remove-legacy-port.yaml
Original file line number Diff line number Diff line change
@@ -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:
3 changes: 1 addition & 2 deletions pkg/collector/adapters/config_to_ports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
11 changes: 2 additions & 9 deletions pkg/collector/parser/receiver_otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
},
},
},
} {
Expand Down
5 changes: 2 additions & 3 deletions pkg/collector/parser/receiver_otlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions tests/e2e/ingress/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 0 additions & 10 deletions tests/e2e/smoke-init-containers/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ spec:
port: 4318
protocol: TCP
targetPort: 4318
- appProtocol: http
name: otlp-http-legacy
port: 55681
protocol: TCP
targetPort: 4318

---

Expand All @@ -62,8 +57,3 @@ spec:
port: 4318
protocol: TCP
targetPort: 4318
- appProtocol: http
name: otlp-http-legacy
port: 55681
protocol: TCP
targetPort: 4318
10 changes: 0 additions & 10 deletions tests/e2e/smoke-simplest/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ spec:
port: 4318
protocol: TCP
targetPort: 4318
- appProtocol: http
name: otlp-http-legacy
port: 55681
protocol: TCP
targetPort: 4318

---

Expand All @@ -57,8 +52,3 @@ spec:
port: 4318
protocol: TCP
targetPort: 4318
- appProtocol: http
name: otlp-http-legacy
port: 55681
protocol: TCP
targetPort: 4318

0 comments on commit 7124a96

Please sign in to comment.