Skip to content

Commit

Permalink
[config/configrpc] Deprecate SanitizedEndpoint, ToListener and ToList…
Browse files Browse the repository at this point in the history
…enerContext (open-telemetry#9512)

**Description:** 

Updates open-telemetry#9481 and open-telemetry#9482
  • Loading branch information
mx-psi authored Feb 9, 2024
1 parent 9553bfe commit a567d2a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .chloggen/mx-psi_deprecate-configgrpc.yaml
Original file line number Diff line number Diff line change
@@ -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]
4 changes: 3 additions & 1 deletion config/configgrpc/configgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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())
}
Expand Down

0 comments on commit a567d2a

Please sign in to comment.