Skip to content

Commit c738871

Browse files
committed
Remove stable gate component.UseLocalHostAsDefaultHost
Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 2b480f6 commit c738871

File tree

2 files changed

+25
-31
lines changed

2 files changed

+25
-31
lines changed

.chloggen/rm-stable-gate.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: service
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Remove stable gate component.UseLocalHostAsDefaultHost
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [11412]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: [user]

internal/globalgates/globalgates.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
package globalgates // import "go.opentelemetry.io/collector/internal/globalgates"
55

66
import (
7-
"errors"
8-
97
"go.opentelemetry.io/collector/featuregate"
108
)
119

@@ -14,32 +12,3 @@ var NoopTracerProvider = featuregate.GlobalRegistry().MustRegister("service.noop
1412
featuregate.WithRegisterFromVersion("v0.107.0"),
1513
featuregate.WithRegisterToVersion("v0.109.0"),
1614
featuregate.WithRegisterDescription("Sets a Noop OpenTelemetry TracerProvider to reduce memory allocations. This featuregate is incompatible with the zPages extension."))
17-
18-
var _ = mustRegisterOrLoad(
19-
featuregate.GlobalRegistry(),
20-
"component.UseLocalHostAsDefaultHost",
21-
featuregate.StageStable,
22-
featuregate.WithRegisterToVersion("v0.110.0"),
23-
featuregate.WithRegisterDescription("controls whether server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints"),
24-
)
25-
26-
// mustRegisterOrLoad tries to register the feature gate and loads it if it already exists.
27-
// It panics on any other error.
28-
func mustRegisterOrLoad(reg *featuregate.Registry, id string, stage featuregate.Stage, opts ...featuregate.RegisterOption) *featuregate.Gate {
29-
gate, err := reg.Register(id, stage, opts...)
30-
31-
if errors.Is(err, featuregate.ErrAlreadyRegistered) {
32-
// Gate is already registered; find it.
33-
// Only a handful of feature gates are registered, so it's fine to iterate over all of them.
34-
reg.VisitAll(func(g *featuregate.Gate) {
35-
if g.ID() == id {
36-
gate = g
37-
return
38-
}
39-
})
40-
} else if err != nil {
41-
panic(err)
42-
}
43-
44-
return gate
45-
}

0 commit comments

Comments
 (0)