Skip to content

Commit

Permalink
[processor/k8sattributes] Move k8sattr.fieldExtractConfigRegex.disall…
Browse files Browse the repository at this point in the history
…ow 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]>
  • Loading branch information
2 people authored and sbylica-splunk committed Dec 17, 2024
1 parent b7bc6b9 commit c81c040
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
26 changes: 26 additions & 0 deletions .chloggen/k8sattributeprocessor-fg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: k8sattributesprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Move k8sattr.fieldExtractConfigRegex.disallow feature gate to Beta."

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [25128]

# (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: "Disable the `k8sattr.fieldExtractConfigRegex.disallow` feature gate to get the old behavior."
# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# 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: []
2 changes: 1 addition & 1 deletion processor/k8sattributesprocessor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

var disallowFieldExtractConfigRegex = featuregate.GlobalRegistry().MustRegister(
"k8sattr.fieldExtractConfigRegex.disallow",
featuregate.StageAlpha,
featuregate.StageBeta,
featuregate.WithRegisterDescription("When enabled, usage of the FieldExtractConfig.Regex field is disallowed"),
featuregate.WithRegisterFromVersion("v0.106.0"),
)
Expand Down
8 changes: 5 additions & 3 deletions processor/k8sattributesprocessor/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func TestLoadConfig(t *testing.T) {
},
WaitForMetadataTimeout: 10 * time.Second,
},
disallowRegex: false,
},
{
id: component.NewIDWithName(metadata.Type, "3"),
Expand Down Expand Up @@ -155,6 +156,7 @@ func TestLoadConfig(t *testing.T) {
},
WaitForMetadataTimeout: 10 * time.Second,
},
disallowRegex: false,
},
{
id: component.NewIDWithName(metadata.Type, "too_many_sources"),
Expand Down Expand Up @@ -209,10 +211,10 @@ func TestLoadConfig(t *testing.T) {

for _, tt := range tests {
t.Run(tt.id.String(), func(t *testing.T) {
if tt.disallowRegex {
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), true))
if !tt.disallowRegex {
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), false))
t.Cleanup(func() {
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), false))
require.NoError(t, featuregate.GlobalRegistry().Set(disallowFieldExtractConfigRegex.ID(), true))
})
}
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
Expand Down

0 comments on commit c81c040

Please sign in to comment.