From e23a43964d312a3d557708d3a497989a60a50070 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Mon, 13 May 2024 13:47:18 -0600 Subject: [PATCH] [confighttp] Remove deprecated functions (#10138) Closes https://github.com/open-telemetry/opentelemetry-collector/issues/9807 --- .../confighttp-remove-deprecated-funcs.yaml | 25 +++++++++++++++++++ config/confighttp/confighttp.go | 15 ----------- 2 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 .chloggen/confighttp-remove-deprecated-funcs.yaml diff --git a/.chloggen/confighttp-remove-deprecated-funcs.yaml b/.chloggen/confighttp-remove-deprecated-funcs.yaml new file mode 100644 index 00000000000..796df0362a1 --- /dev/null +++ b/.chloggen/confighttp-remove-deprecated-funcs.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# 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. otlpreceiver) +component: confighttp + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Removes deprecated functions `ToClientContext`, `ToListenerContext`, and `ToServerContext`. + +# One or more tracking issues or pull requests related to the change +issues: [10138] + +# (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: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [api] diff --git a/config/confighttp/confighttp.go b/config/confighttp/confighttp.go index 067f9d3a0ab..e2b2cab48c8 100644 --- a/config/confighttp/confighttp.go +++ b/config/confighttp/confighttp.go @@ -233,11 +233,6 @@ func (hcs *ClientConfig) ToClient(ctx context.Context, host component.Host, sett }, nil } -// Deprecated: [v0.99.0] Use ToClient instead. -func (hcs *ClientConfig) ToClientContext(ctx context.Context, host component.Host, settings component.TelemetrySettings) (*http.Client, error) { - return hcs.ToClient(ctx, host, settings) -} - // Custom RoundTripper that adds headers. type headerRoundTripper struct { transport http.RoundTripper @@ -289,11 +284,6 @@ type ServerConfig struct { ResponseHeaders map[string]configopaque.String `mapstructure:"response_headers"` } -// Deprecated: [v0.99.0] Use ToListener instead. -func (hss *ServerConfig) ToListenerContext(ctx context.Context) (net.Listener, error) { - return hss.ToListener(ctx) -} - // ToListener creates a net.Listener. func (hss *ServerConfig) ToListener(ctx context.Context) (net.Listener, error) { listener, err := net.Listen("tcp", hss.Endpoint) @@ -344,11 +334,6 @@ func WithDecoder(key string, dec func(body io.ReadCloser) (io.ReadCloser, error) } } -// Deprecated: [v0.99.0] Use ToServer instead. -func (hss *ServerConfig) ToServerContext(ctx context.Context, host component.Host, settings component.TelemetrySettings, handler http.Handler, opts ...ToServerOption) (*http.Server, error) { - return hss.ToServer(ctx, host, settings, handler, opts...) -} - // ToServer creates an http.Server from settings object. func (hss *ServerConfig) ToServer(_ context.Context, host component.Host, settings component.TelemetrySettings, handler http.Handler, opts ...ToServerOption) (*http.Server, error) { internal.WarnOnUnspecifiedHost(settings.Logger, hss.Endpoint)