Skip to content

Commit 9668658

Browse files
authored
Mark confmap.expandEnabled as stable (#7323)
Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 1374845 commit 9668658

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

.chloggen/stableexpandEnabled.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: enhancement
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
5+
component: confmap
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Mark `confmap.expandEnabled` as stable
9+
10+
# One or more tracking issues or pull requests related to the change
11+
issues: [7323]

confmap/resolver.go

+10-12
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ var (
4747
errTooManyRecursiveExpansions = errors.New("too many recursive expansions")
4848
)
4949

50-
// TODO: Remove this if by v0.64.0 no complains from distros.
51-
var expandEnabledGauge = featuregate.GlobalRegistry().MustRegister(
50+
var _ = featuregate.GlobalRegistry().MustRegister(
5251
"confmap.expandEnabled",
53-
featuregate.StageBeta,
52+
featuregate.StageStable,
53+
featuregate.WithRegisterRemovalVersion("v0.75.0"),
5454
featuregate.WithRegisterDescription("controls whether expanding embedded external config providers URIs"))
5555

5656
// Resolver resolves a configuration as a Conf.
@@ -165,17 +165,15 @@ func (mr *Resolver) Resolve(ctx context.Context) (*Conf, error) {
165165
}
166166
}
167167

168-
if expandEnabledGauge.IsEnabled() {
169-
cfgMap := make(map[string]any)
170-
for _, k := range retMap.AllKeys() {
171-
val, err := mr.expandValueRecursively(ctx, retMap.Get(k))
172-
if err != nil {
173-
return nil, err
174-
}
175-
cfgMap[k] = val
168+
cfgMap := make(map[string]any)
169+
for _, k := range retMap.AllKeys() {
170+
val, err := mr.expandValueRecursively(ctx, retMap.Get(k))
171+
if err != nil {
172+
return nil, err
176173
}
177-
retMap = NewFromStringMap(cfgMap)
174+
cfgMap[k] = val
178175
}
176+
retMap = NewFromStringMap(cfgMap)
179177

180178
// Apply the converters in the given order.
181179
for _, confConv := range mr.converters {

0 commit comments

Comments
 (0)