From a567d2af2e172875bf4517159f77cc5982468364 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Fri, 9 Feb 2024 03:45:03 +0000 Subject: [PATCH] [config/configrpc] Deprecate SanitizedEndpoint, ToListener and ToListenerContext (#9512) **Description:** Updates #9481 and #9482 --- .chloggen/mx-psi_deprecate-configgrpc.yaml | 25 ++++++++++++++++++++++ config/configgrpc/configgrpc.go | 4 +++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 .chloggen/mx-psi_deprecate-configgrpc.yaml diff --git a/.chloggen/mx-psi_deprecate-configgrpc.yaml b/.chloggen/mx-psi_deprecate-configgrpc.yaml new file mode 100755 index 00000000000..0e4071d7e3e --- /dev/null +++ b/.chloggen/mx-psi_deprecate-configgrpc.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: deprecation + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: config/configgrpc + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Deprecate `configgrpc.ClientConfig.SanitizedEndpoint`, `configgrpc.ServerConfig.ToListener` and `configgrpc.ServerConfig.ToListenerContext` + +# One or more tracking issues or pull requests related to the change +issues: [9481, 9482] + +# (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/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go index 92708209a22..1bc9d252c4d 100644 --- a/config/configgrpc/configgrpc.go +++ b/config/configgrpc/configgrpc.go @@ -160,6 +160,7 @@ type ServerConfig struct { } // SanitizedEndpoint strips the prefix of either http:// or https:// from configgrpc.ClientConfig.Endpoint. +// Deprecated: [v0.95.0] Trim the prefix from configgrpc.ClientConfig.Endpoint directly. func (gcs *ClientConfig) SanitizedEndpoint() string { switch { case gcs.isSchemeHTTP(): @@ -277,12 +278,13 @@ func validateBalancerName(balancerName string) bool { } // ToListenerContext returns the net.Listener constructed from the settings. +// Deprecated: [v0.95.0] Call Listen directly on the NetAddr field. func (gss *ServerConfig) ToListenerContext(ctx context.Context) (net.Listener, error) { return gss.NetAddr.Listen(ctx) } // ToListener returns the net.Listener constructed from the settings. -// Deprecated: [v0.94.0] use ToListenerContext instead. +// Deprecated: [v0.94.0] Call Listen directly on the NetAddr field. func (gss *ServerConfig) ToListener() (net.Listener, error) { return gss.ToListenerContext(context.Background()) }