From b86b89a10d9c26f47448a639a5c6fdf0824ade81 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Fri, 6 Oct 2023 08:35:49 -0700 Subject: [PATCH 1/2] [chore] remove code that was deprecated some time ago This was deprecated many versions ago, should have been removed but i suspect was missed due to typo. Signed-off-by: Alex Boten --- .chloggen/codeboten_rm-deprecated68.yaml | 25 ++++++++++++++++++++++++ service/extensions/extensions.go | 9 --------- service/extensions/extensions_test.go | 14 ++++++------- 3 files changed, 31 insertions(+), 17 deletions(-) create mode 100755 .chloggen/codeboten_rm-deprecated68.yaml diff --git a/.chloggen/codeboten_rm-deprecated68.yaml b/.chloggen/codeboten_rm-deprecated68.yaml new file mode 100755 index 00000000000..db3023c5064 --- /dev/null +++ b/.chloggen/codeboten_rm-deprecated68.yaml @@ -0,0 +1,25 @@ +# 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. otlpreceiver) +component: extension + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: remove deprecated Configs and Factories + +# One or more tracking issues or pull requests related to the change +issues: [] + +# (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: + +# 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: [api] \ No newline at end of file diff --git a/service/extensions/extensions.go b/service/extensions/extensions.go index 5ff92cd5852..54af9d6544c 100644 --- a/service/extensions/extensions.go +++ b/service/extensions/extensions.go @@ -123,21 +123,12 @@ type Settings struct { Telemetry component.TelemetrySettings BuildInfo component.BuildInfo - // Drepecated: [v0.68.0] use Extensions. - Configs map[component.ID]component.Config - - // Drepecated: [v0.68.0] use Extensions. - Factories map[component.Type]extension.Factory - // Extensions builder for extensions. Extensions *extension.Builder } // New creates a new Extensions from Config. func New(ctx context.Context, set Settings, cfg Config) (*Extensions, error) { - if set.Extensions == nil { - set.Extensions = extension.NewBuilder(set.Configs, set.Factories) - } exts := &Extensions{ telemetry: set.Telemetry, extMap: make(map[component.ID]extension.Extension), diff --git a/service/extensions/extensions_test.go b/service/extensions/extensions_test.go index d244fe0e8dd..cbb3dd5238d 100644 --- a/service/extensions/extensions_test.go +++ b/service/extensions/extensions_test.go @@ -81,10 +81,9 @@ func TestBuildExtensions(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { _, err := New(context.Background(), Settings{ - Telemetry: componenttest.NewNopTelemetrySettings(), - BuildInfo: component.NewDefaultBuildInfo(), - Configs: tt.extensionsConfigs, - Factories: tt.factories, + Telemetry: componenttest.NewNopTelemetrySettings(), + BuildInfo: component.NewDefaultBuildInfo(), + Extensions: extension.NewBuilder(tt.extensionsConfigs, tt.factories), }, tt.config) require.Error(t, err) assert.EqualError(t, err, tt.wantErrMsg) @@ -168,10 +167,9 @@ func TestNotifyConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { extensions, err := New(context.Background(), Settings{ - Telemetry: componenttest.NewNopTelemetrySettings(), - BuildInfo: component.NewDefaultBuildInfo(), - Configs: tt.extensionsConfigs, - Factories: tt.factories, + Telemetry: componenttest.NewNopTelemetrySettings(), + BuildInfo: component.NewDefaultBuildInfo(), + Extensions: extension.NewBuilder(tt.extensionsConfigs, tt.factories), }, tt.serviceExtensions) assert.NoError(t, err) errs := extensions.NotifyConfig(context.Background(), confmap.NewFromStringMap(map[string]interface{}{})) From 5c1be156dd8e07b7b889c28ab6ba4a973fef2cab Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Fri, 6 Oct 2023 08:37:06 -0700 Subject: [PATCH 2/2] Update .chloggen/codeboten_rm-deprecated68.yaml --- .chloggen/codeboten_rm-deprecated68.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/codeboten_rm-deprecated68.yaml b/.chloggen/codeboten_rm-deprecated68.yaml index db3023c5064..1046acba24e 100755 --- a/.chloggen/codeboten_rm-deprecated68.yaml +++ b/.chloggen/codeboten_rm-deprecated68.yaml @@ -10,7 +10,7 @@ component: extension note: remove deprecated Configs and Factories # One or more tracking issues or pull requests related to the change -issues: [] +issues: [8631] # (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.