Skip to content

Commit

Permalink
[chore] remove code that was deprecated some time ago (#8631)
Browse files Browse the repository at this point in the history
This was deprecated many versions ago, should have been removed but i
suspect was missed due to typo.

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten authored Oct 6, 2023
1 parent 7ee0b28 commit d364ad6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
25 changes: 25 additions & 0 deletions .chloggen/codeboten_rm-deprecated68.yaml
Original file line number Diff line number Diff line change
@@ -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: [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.
# 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]
9 changes: 0 additions & 9 deletions service/extensions/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
14 changes: 6 additions & 8 deletions service/extensions/extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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{}{}))
Expand Down

0 comments on commit d364ad6

Please sign in to comment.