Skip to content

Commit c927866

Browse files
odubajDTChrsMark
authored andcommitted
[processor/k8sattributes] Move k8sattr.fieldExtractConfigRegex.disallow feature gate to Beta (open-telemetry#36410)
<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#25128 --------- Signed-off-by: odubajDT <[email protected]> Co-authored-by: Christos Markou <[email protected]>
1 parent 61ce5b6 commit c927866

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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. filelogreceiver)
7+
component: k8sattributesprocessor
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "Move k8sattr.fieldExtractConfigRegex.disallow feature gate to Beta."
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [25128]
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: "Disable the `k8sattr.fieldExtractConfigRegex.disallow` feature gate to get the old behavior."
19+
# If your change doesn't affect end users or the exported elements of any package,
20+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
21+
# Optional: The change log or logs in which this entry should be included.
22+
# e.g. '[user]' or '[user, api]'
23+
# Include 'user' if the change is relevant to end users.
24+
# Include 'api' if there is a change to a library API.
25+
# Default: '[user]'
26+
change_logs: []

processor/k8sattributesprocessor/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
var disallowFieldExtractConfigRegex = featuregate.GlobalRegistry().MustRegister(
1919
"k8sattr.fieldExtractConfigRegex.disallow",
20-
featuregate.StageAlpha,
20+
featuregate.StageBeta,
2121
featuregate.WithRegisterDescription("When enabled, usage of the FieldExtractConfig.Regex field is disallowed"),
2222
featuregate.WithRegisterFromVersion("v0.106.0"),
2323
)

processor/k8sattributesprocessor/config_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ func TestLoadConfig(t *testing.T) {
109109
},
110110
WaitForMetadataTimeout: 10 * time.Second,
111111
},
112+
disallowRegex: false,
112113
},
113114
{
114115
id: component.NewIDWithName(metadata.Type, "3"),
@@ -155,6 +156,7 @@ func TestLoadConfig(t *testing.T) {
155156
},
156157
WaitForMetadataTimeout: 10 * time.Second,
157158
},
159+
disallowRegex: false,
158160
},
159161
{
160162
id: component.NewIDWithName(metadata.Type, "too_many_sources"),
@@ -209,10 +211,10 @@ func TestLoadConfig(t *testing.T) {
209211

210212
for _, tt := range tests {
211213
t.Run(tt.id.String(), func(t *testing.T) {
212-
if tt.disallowRegex {
213-
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), true))
214+
if !tt.disallowRegex {
215+
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), false))
214216
t.Cleanup(func() {
215-
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), false))
217+
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), true))
216218
})
217219
}
218220
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))

0 commit comments

Comments
 (0)