From 265c312cfdfcfd3ea1c6dbdb7a764fffb3a2de38 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 6 Mar 2023 10:33:16 -0800 Subject: [PATCH] Mark confmap.expandEnabled as stable Signed-off-by: Bogdan Drutu --- .chloggen/stableexpandEnabled.yaml | 11 +++++++++++ confmap/resolver.go | 22 ++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) create mode 100755 .chloggen/stableexpandEnabled.yaml diff --git a/.chloggen/stableexpandEnabled.yaml b/.chloggen/stableexpandEnabled.yaml new file mode 100755 index 00000000000..55d73c2621d --- /dev/null +++ b/.chloggen/stableexpandEnabled.yaml @@ -0,0 +1,11 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: confmap + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Mark `confmap.expandEnabled` as stable + +# One or more tracking issues or pull requests related to the change +issues: [7323] diff --git a/confmap/resolver.go b/confmap/resolver.go index ba9a33efa2a..f57e2995faa 100644 --- a/confmap/resolver.go +++ b/confmap/resolver.go @@ -47,10 +47,10 @@ var ( errTooManyRecursiveExpansions = errors.New("too many recursive expansions") ) -// TODO: Remove this if by v0.64.0 no complains from distros. -var expandEnabledGauge = featuregate.GlobalRegistry().MustRegister( +var _ = featuregate.GlobalRegistry().MustRegister( "confmap.expandEnabled", - featuregate.StageBeta, + featuregate.StageStable, + featuregate.WithRegisterRemovalVersion("v0.75.0"), featuregate.WithRegisterDescription("controls whether expanding embedded external config providers URIs")) // Resolver resolves a configuration as a Conf. @@ -165,17 +165,15 @@ func (mr *Resolver) Resolve(ctx context.Context) (*Conf, error) { } } - if expandEnabledGauge.IsEnabled() { - cfgMap := make(map[string]any) - for _, k := range retMap.AllKeys() { - val, err := mr.expandValueRecursively(ctx, retMap.Get(k)) - if err != nil { - return nil, err - } - cfgMap[k] = val + cfgMap := make(map[string]any) + for _, k := range retMap.AllKeys() { + val, err := mr.expandValueRecursively(ctx, retMap.Get(k)) + if err != nil { + return nil, err } - retMap = NewFromStringMap(cfgMap) + cfgMap[k] = val } + retMap = NewFromStringMap(cfgMap) // Apply the converters in the given order. for _, confConv := range mr.converters {