From 7bd3d7537e42771555776ed82fe4c83c076dc508 Mon Sep 17 00:00:00 2001 From: odubajDT Date: Mon, 18 Nov 2024 14:03:52 +0100 Subject: [PATCH 1/4] [processor/k8sattributes] Move k8sattr.fieldExtractConfigRegex.disallow feature gate to Beta Signed-off-by: odubajDT --- .chloggen/k8sattributeprocessor-fg.yaml | 27 ++++++++++++++++++++++ processor/k8sattributesprocessor/config.go | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .chloggen/k8sattributeprocessor-fg.yaml diff --git a/.chloggen/k8sattributeprocessor-fg.yaml b/.chloggen/k8sattributeprocessor-fg.yaml new file mode 100644 index 0000000000000..0c5d1ed1280fa --- /dev/null +++ b/.chloggen/k8sattributeprocessor-fg.yaml @@ -0,0 +1,27 @@ +# 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: + +# 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: [] diff --git a/processor/k8sattributesprocessor/config.go b/processor/k8sattributesprocessor/config.go index e5651a087bf4f..336a50cd38091 100644 --- a/processor/k8sattributesprocessor/config.go +++ b/processor/k8sattributesprocessor/config.go @@ -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"), ) From ac90f94d6a209d44ac40340c0a490bb971b1207c Mon Sep 17 00:00:00 2001 From: odubajDT Date: Mon, 18 Nov 2024 14:29:42 +0100 Subject: [PATCH 2/4] adapt tests Signed-off-by: odubajDT --- processor/k8sattributesprocessor/config_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/processor/k8sattributesprocessor/config_test.go b/processor/k8sattributesprocessor/config_test.go index 9510df99a3b70..db8ae337737cd 100644 --- a/processor/k8sattributesprocessor/config_test.go +++ b/processor/k8sattributesprocessor/config_test.go @@ -109,6 +109,7 @@ func TestLoadConfig(t *testing.T) { }, WaitForMetadataTimeout: 10 * time.Second, }, + disallowRegex: false, }, { id: component.NewIDWithName(metadata.Type, "3"), @@ -155,6 +156,7 @@ func TestLoadConfig(t *testing.T) { }, WaitForMetadataTimeout: 10 * time.Second, }, + disallowRegex: false, }, { id: component.NewIDWithName(metadata.Type, "too_many_sources"), @@ -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")) From c4fffc2647bb084cdedc6c4aefa0494f402c74d6 Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:24:14 +0100 Subject: [PATCH 3/4] Update .chloggen/k8sattributeprocessor-fg.yaml Co-authored-by: Christos Markou --- .chloggen/k8sattributeprocessor-fg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/k8sattributeprocessor-fg.yaml b/.chloggen/k8sattributeprocessor-fg.yaml index 0c5d1ed1280fa..9c5196412b0dc 100644 --- a/.chloggen/k8sattributeprocessor-fg.yaml +++ b/.chloggen/k8sattributeprocessor-fg.yaml @@ -16,7 +16,7 @@ issues: [25128] # 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. From 6d5b74f877b26ab212bf89f081a94b523df30568 Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:33:17 +0100 Subject: [PATCH 4/4] Update .chloggen/k8sattributeprocessor-fg.yaml --- .chloggen/k8sattributeprocessor-fg.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.chloggen/k8sattributeprocessor-fg.yaml b/.chloggen/k8sattributeprocessor-fg.yaml index 9c5196412b0dc..c2e6727027157 100644 --- a/.chloggen/k8sattributeprocessor-fg.yaml +++ b/.chloggen/k8sattributeprocessor-fg.yaml @@ -15,8 +15,7 @@ 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. +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.