Skip to content

Commit

Permalink
internal/components: move default address
Browse files Browse the repository at this point in the history
Signed-off-by: Benedikt Bongartz <[email protected]>
  • Loading branch information
frzifus committed Oct 7, 2024
1 parent 63f5d1c commit 7740639
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
2 changes: 1 addition & 1 deletion internal/components/multi_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (m *MultiPortReceiver) GetRBACRules(logr.Logger, interface{}) ([]rbacv1.Pol
type MultiPortBuilder[ComponentConfigType any] []Builder[ComponentConfigType]

func NewMultiPortReceiverBuilder(name string) MultiPortBuilder[*MultiProtocolEndpointConfig] {
return append(MultiPortBuilder[*MultiProtocolEndpointConfig]{}, NewBuilder[*MultiProtocolEndpointConfig]().WithName(name))
return append(MultiPortBuilder[*MultiProtocolEndpointConfig]{}, NewBuilder[*MultiProtocolEndpointConfig]().WithName(name).WithDefaultRecAddress("0.0.0.0"))
}

func NewProtocolBuilder(name string, port int32) Builder[*MultiProtocolEndpointConfig] {
Expand Down
24 changes: 0 additions & 24 deletions internal/components/receivers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,112 +52,88 @@ var (
components.NewMultiPortReceiverBuilder("otlp").
AddPortMapping(components.NewProtocolBuilder("grpc", 4317).
WithAppProtocol(&components.GrpcProtocol).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(4317)).
AddPortMapping(components.NewProtocolBuilder("http", 4318).
WithAppProtocol(&components.HttpProtocol).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(4318)).
MustBuild(),
components.NewMultiPortReceiverBuilder("skywalking").
AddPortMapping(components.NewProtocolBuilder(components.GrpcProtocol, 11800).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(11800).
WithAppProtocol(&components.GrpcProtocol)).
AddPortMapping(components.NewProtocolBuilder(components.HttpProtocol, 12800).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(12800).
WithAppProtocol(&components.HttpProtocol)).
MustBuild(),
components.NewMultiPortReceiverBuilder("jaeger").
AddPortMapping(components.NewProtocolBuilder(components.GrpcProtocol, 14250).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(14250).
WithProtocol(corev1.ProtocolTCP).
WithAppProtocol(&components.GrpcProtocol)).
AddPortMapping(components.NewProtocolBuilder("thrift_http", 14268).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(14268).
WithProtocol(corev1.ProtocolTCP).
WithAppProtocol(&components.HttpProtocol)).
AddPortMapping(components.NewProtocolBuilder("thrift_compact", 6831).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(6831).
WithProtocol(corev1.ProtocolUDP)).
AddPortMapping(components.NewProtocolBuilder("thrift_binary", 6832).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(6832).
WithProtocol(corev1.ProtocolUDP)).
MustBuild(),
components.NewMultiPortReceiverBuilder("loki").
AddPortMapping(components.NewProtocolBuilder(components.GrpcProtocol, 9095).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(9095).
WithAppProtocol(&components.GrpcProtocol)).
AddPortMapping(components.NewProtocolBuilder(components.HttpProtocol, 3100).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(3100).
WithAppProtocol(&components.HttpProtocol)).
MustBuild(),
components.NewSinglePortParserBuilder("awsxray", 2000).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(2000).
WithProtocol(corev1.ProtocolUDP).
MustBuild(),
components.NewSinglePortParserBuilder("carbon", 2003).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(2003).
MustBuild(),
components.NewSinglePortParserBuilder("collectd", 8081).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(8081).
MustBuild(),
components.NewSinglePortParserBuilder("fluentforward", 8006).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(8006).
MustBuild(),
components.NewSinglePortParserBuilder("influxdb", 8086).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(8086).
MustBuild(),
components.NewSinglePortParserBuilder("opencensus", 55678).
WithAppProtocol(nil).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(55678).
MustBuild(),
components.NewSinglePortParserBuilder("sapm", 7276).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(7276).
MustBuild(),
components.NewSinglePortParserBuilder("signalfx", 9943).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(9943).
MustBuild(),
components.NewSinglePortParserBuilder("splunk_hec", 8088).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(8088).
MustBuild(),
components.NewSinglePortParserBuilder("statsd", 8125).
WithDefaultRecAddress("0.0.0.0").
WithProtocol(corev1.ProtocolUDP).
WithTargetPort(8125).
MustBuild(),
components.NewSinglePortParserBuilder("tcplog", components.UnsetPort).
WithDefaultRecAddress("0.0.0.0").
WithProtocol(corev1.ProtocolTCP).
MustBuild(),
components.NewSinglePortParserBuilder("udplog", components.UnsetPort).
WithDefaultRecAddress("0.0.0.0").
WithProtocol(corev1.ProtocolUDP).
MustBuild(),
components.NewSinglePortParserBuilder("wavefront", 2003).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(2003).
MustBuild(),
components.NewSinglePortParserBuilder("zipkin", 9411).
WithAppProtocol(&components.HttpProtocol).
WithProtocol(corev1.ProtocolTCP).
WithDefaultRecAddress("0.0.0.0").
WithTargetPort(3100).
MustBuild(),
NewScraperParser("prometheus"),
Expand Down
2 changes: 1 addition & 1 deletion internal/components/single_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func internalParseSingleEndpoint(logger logr.Logger, name string, failSilently b
}

func NewSinglePortParserBuilder(name string, port int32) Builder[*SingleEndpointConfig] {
return NewBuilder[*SingleEndpointConfig]().WithPort(port).WithName(name).WithPortParser(ParseSingleEndpoint).WithDefaultsApplier(AddressDefaulter)
return NewBuilder[*SingleEndpointConfig]().WithPort(port).WithName(name).WithPortParser(ParseSingleEndpoint).WithDefaultsApplier(AddressDefaulter).WithDefaultRecAddress("0.0.0.0")
}

func NewSilentSinglePortParserBuilder(name string, port int32) Builder[*SingleEndpointConfig] {
Expand Down

0 comments on commit 7740639

Please sign in to comment.