From 624662e242d805cb4eea83910b3740df4fa6f028 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 13 Nov 2024 13:00:05 -0800 Subject: [PATCH] Remove deprecated expandvar converter Signed-off-by: Bogdan Drutu --- .chloggen/rm-dep-expandvar.yaml | 25 ++ Makefile | 2 - confmap/converter/expandconverter/Makefile | 1 - confmap/converter/expandconverter/expand.go | 112 ------- .../converter/expandconverter/expand_test.go | 290 ------------------ confmap/converter/expandconverter/go.mod | 27 -- confmap/converter/expandconverter/go.sum | 35 --- .../converter/expandconverter/package_test.go | 14 - .../testdata/default-config.yaml | 5 - .../testdata/errors/expand-list-error.yaml | 4 - .../errors/expand-list-map-error.yaml | 3 - .../testdata/errors/expand-map-error.yaml | 2 - .../testdata/expand-escaped-env.yaml | 15 - .../testdata/expand-with-all-env.yaml | 11 - .../testdata/expand-with-no-env.yaml | 10 - .../testdata/expand-with-partial-env.yaml | 10 - versions.yaml | 1 - 17 files changed, 25 insertions(+), 542 deletions(-) create mode 100644 .chloggen/rm-dep-expandvar.yaml delete mode 100644 confmap/converter/expandconverter/Makefile delete mode 100644 confmap/converter/expandconverter/expand.go delete mode 100644 confmap/converter/expandconverter/expand_test.go delete mode 100644 confmap/converter/expandconverter/go.mod delete mode 100644 confmap/converter/expandconverter/go.sum delete mode 100644 confmap/converter/expandconverter/package_test.go delete mode 100644 confmap/converter/expandconverter/testdata/default-config.yaml delete mode 100644 confmap/converter/expandconverter/testdata/errors/expand-list-error.yaml delete mode 100644 confmap/converter/expandconverter/testdata/errors/expand-list-map-error.yaml delete mode 100644 confmap/converter/expandconverter/testdata/errors/expand-map-error.yaml delete mode 100644 confmap/converter/expandconverter/testdata/expand-escaped-env.yaml delete mode 100644 confmap/converter/expandconverter/testdata/expand-with-all-env.yaml delete mode 100644 confmap/converter/expandconverter/testdata/expand-with-no-env.yaml delete mode 100644 confmap/converter/expandconverter/testdata/expand-with-partial-env.yaml diff --git a/.chloggen/rm-dep-expandvar.yaml b/.chloggen/rm-dep-expandvar.yaml new file mode 100644 index 00000000000..e012397b1ea --- /dev/null +++ b/.chloggen/rm-dep-expandvar.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: expandconverter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove deprecated expandvar converter + +# One or more tracking issues or pull requests related to the change +issues: [11672] + +# (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] diff --git a/Makefile b/Makefile index 12b522086f5..b90826d6db7 100644 --- a/Makefile +++ b/Makefile @@ -277,7 +277,6 @@ check-contrib: -replace go.opentelemetry.io/collector/config/configtls=$(CURDIR)/config/configtls \ -replace go.opentelemetry.io/collector/config/internal=$(CURDIR)/config/internal \ -replace go.opentelemetry.io/collector/confmap=$(CURDIR)/confmap \ - -replace go.opentelemetry.io/collector/confmap/converter/expandconverter=$(CURDIR)/confmap/converter/expandconverter \ -replace go.opentelemetry.io/collector/confmap/provider/envprovider=$(CURDIR)/confmap/provider/envprovider \ -replace go.opentelemetry.io/collector/confmap/provider/fileprovider=$(CURDIR)/confmap/provider/fileprovider \ -replace go.opentelemetry.io/collector/confmap/provider/httpprovider=$(CURDIR)/confmap/provider/httpprovider \ @@ -358,7 +357,6 @@ restore-contrib: -dropreplace go.opentelemetry.io/collector/config/configtls \ -dropreplace go.opentelemetry.io/collector/config/internal \ -dropreplace go.opentelemetry.io/collector/confmap \ - -dropreplace go.opentelemetry.io/collector/confmap/converter/expandconverter \ -dropreplace go.opentelemetry.io/collector/confmap/provider/envprovider \ -dropreplace go.opentelemetry.io/collector/confmap/provider/fileprovider \ -dropreplace go.opentelemetry.io/collector/confmap/provider/httpprovider \ diff --git a/confmap/converter/expandconverter/Makefile b/confmap/converter/expandconverter/Makefile deleted file mode 100644 index bdd863a203b..00000000000 --- a/confmap/converter/expandconverter/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../../Makefile.Common diff --git a/confmap/converter/expandconverter/expand.go b/confmap/converter/expandconverter/expand.go deleted file mode 100644 index 83b8e4b9dd9..00000000000 --- a/confmap/converter/expandconverter/expand.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package expandconverter // import "go.opentelemetry.io/collector/confmap/converter/expandconverter" - -import ( - "context" - "fmt" - "os" - - "go.uber.org/zap" - - "go.opentelemetry.io/collector/confmap" - "go.opentelemetry.io/collector/confmap/internal/envvar" -) - -type converter struct { - logger *zap.Logger - - // Record of which env vars we have logged a warning for - loggedDeprecations map[string]struct{} -} - -// NewFactory returns a factory for a confmap.Converter, -// which expands all environment variables for a given confmap.Conf. -// -// Deprecated: [v0.107.0] BASH-style env var expansion is deprecated. Use the `envprovider` instead to expand `${FOO}` and `${env:FOO}`. -// Using the expandconverter with `confmap.Resolver` will cause double escaping, so `$$$$` -> `$` instead of `$$`. -func NewFactory() confmap.ConverterFactory { - return confmap.NewConverterFactory(newConverter) -} - -func newConverter(set confmap.ConverterSettings) confmap.Converter { - return converter{ - loggedDeprecations: make(map[string]struct{}), - logger: set.Logger, - } -} - -// Deprecated: [v0.107.0] BASH-style env var expansion is deprecated. Use the `envprovider` instead to expand `${FOO}` and `${env:FOO}`. -// Using the expandconverter with `confmap.Resolver` will cause double escaping, so `$$$$` -> `$` instead of `$$`. -func (c converter) Convert(_ context.Context, conf *confmap.Conf) error { - var err error - out := make(map[string]any) - for _, k := range conf.AllKeys() { - out[k], err = c.expandStringValues(conf.Get(k)) - if err != nil { - return err - } - } - return conf.Merge(confmap.NewFromStringMap(out)) -} - -func (c converter) expandStringValues(value any) (any, error) { - var err error - switch v := value.(type) { - case string: - return c.expandEnv(v) - case []any: - nslice := make([]any, 0, len(v)) - for _, vint := range v { - var nv any - nv, err = c.expandStringValues(vint) - if err != nil { - return nil, err - } - nslice = append(nslice, nv) - } - return nslice, nil - case map[string]any: - nmap := map[string]any{} - for mk, mv := range v { - nmap[mk], err = c.expandStringValues(mv) - if err != nil { - return nil, err - } - } - return nmap, nil - default: - return v, nil - } -} - -func (c converter) expandEnv(s string) (string, error) { - var err error - res := os.Expand(s, func(str string) string { - // This allows escaping environment variable substitution via $$, e.g. - // - $FOO will be substituted with env var FOO - // - $$FOO will be replaced with $FOO - // - $$$FOO will be replaced with $ + substituted env var FOO - // TODO: Move the escaping of $$ out from the expand converter to the resolver. - if str == "$" { - return "$" - } - - // For $ENV style environment variables os.Expand returns once it hits a character that isn't an underscore or - // an alphanumeric character - so we cannot detect those malformed environment variables. - // For ${ENV} style variables we can detect those kinds of env var names! - if !envvar.ValidationRegexp.MatchString(str) { - err = fmt.Errorf("environment variable %q has invalid name: must match regex %s", str, envvar.ValidationPattern) - return "" - } - val, exists := os.LookupEnv(str) - if !exists { - c.logger.Warn("Configuration references unset environment variable", zap.String("name", str)) - } else if len(val) == 0 { - c.logger.Info("Configuration references empty environment variable", zap.String("name", str)) - } - return val - }) - return res, err -} diff --git a/confmap/converter/expandconverter/expand_test.go b/confmap/converter/expandconverter/expand_test.go deleted file mode 100644 index c86c44aeb75..00000000000 --- a/confmap/converter/expandconverter/expand_test.go +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package expandconverter - -import ( - "context" - "fmt" - "path/filepath" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "go.uber.org/zap/zaptest/observer" - - "go.opentelemetry.io/collector/confmap" - "go.opentelemetry.io/collector/confmap/confmaptest" - "go.opentelemetry.io/collector/confmap/internal/envvar" -) - -func TestNewExpandConverter(t *testing.T) { - var testCases = []struct { - name string // test case name (also file name containing config yaml) - }{ - {name: "expand-with-no-env.yaml"}, - {name: "expand-with-partial-env.yaml"}, - {name: "expand-with-all-env.yaml"}, - } - - const valueExtra = "some string" - const valueExtraMapValue = "some map value" - const valueExtraListMapValue = "some list map value" - const valueExtraListElement = "some list value" - t.Setenv("EXTRA", valueExtra) - t.Setenv("EXTRA_MAP_VALUE_1", valueExtraMapValue+"_1") - t.Setenv("EXTRA_MAP_VALUE_2", valueExtraMapValue+"_2") - t.Setenv("EXTRA_LIST_MAP_VALUE_1", valueExtraListMapValue+"_1") - t.Setenv("EXTRA_LIST_MAP_VALUE_2", valueExtraListMapValue+"_2") - t.Setenv("EXTRA_LIST_VALUE_1", valueExtraListElement+"_1") - t.Setenv("EXTRA_LIST_VALUE_2", valueExtraListElement+"_2") - - expectedCfgMap, errExpected := confmaptest.LoadConf(filepath.Join("testdata", "expand-with-no-env.yaml")) - require.NoError(t, errExpected, "Unable to get expected config") - - for _, tt := range testCases { - t.Run(tt.name, func(t *testing.T) { - conf, err := confmaptest.LoadConf(filepath.Join("testdata", tt.name)) - require.NoError(t, err, "Unable to get config") - - // Test that expanded configs are the same with the simple config with no env vars. - require.NoError(t, createConverter().Convert(context.Background(), conf)) - assert.Equal(t, expectedCfgMap.ToStringMap(), conf.ToStringMap()) - }) - } -} - -func TestNewExpandConverter_EscapedMaps(t *testing.T) { - const receiverExtraMapValue = "some map value" - t.Setenv("MAP_VALUE", receiverExtraMapValue) - - conf := confmap.NewFromStringMap( - map[string]any{ - "test_string_map": map[string]any{ - "recv": "$MAP_VALUE", - }, - "test_interface_map": map[any]any{ - "recv": "$MAP_VALUE", - }}, - ) - require.NoError(t, createConverter().Convert(context.Background(), conf)) - - expectedMap := map[string]any{ - "test_string_map": map[string]any{ - "recv": receiverExtraMapValue, - }, - "test_interface_map": map[string]any{ - "recv": receiverExtraMapValue, - }} - assert.Equal(t, expectedMap, conf.ToStringMap()) -} - -func TestNewExpandConverter_EscapedEnvVars(t *testing.T) { - const receiverExtraMapValue = "some map value" - t.Setenv("MAP_VALUE_2", receiverExtraMapValue) - - // Retrieve the config - conf, err := confmaptest.LoadConf(filepath.Join("testdata", "expand-escaped-env.yaml")) - require.NoError(t, err, "Unable to get config") - - expectedMap := map[string]any{ - "test_map": map[string]any{ - // $$ -> escaped $ - "recv.1": "$MAP_VALUE_1", - // $$$ -> escaped $ + substituted env var - "recv.2": "$" + receiverExtraMapValue, - // $$$$ -> two escaped $ - "recv.3": "$$MAP_VALUE_3", - // escaped $ in the middle - "recv.4": "some${MAP_VALUE_4}text", - // $$$$ -> two escaped $ - "recv.5": "${ONE}${TWO}", - // trailing escaped $ - "recv.6": "text$", - // escaped $ alone - "recv.7": "$", - }} - require.NoError(t, createConverter().Convert(context.Background(), conf)) - assert.Equal(t, expectedMap, conf.ToStringMap()) -} - -func TestNewExpandConverterHostPort(t *testing.T) { - t.Setenv("HOST", "127.0.0.1") - t.Setenv("PORT", "4317") - - var testCases = []struct { - name string - input map[string]any - expected map[string]any - }{ - { - name: "brackets", - input: map[string]any{ - "test": "${HOST}:${PORT}", - }, - expected: map[string]any{ - "test": "127.0.0.1:4317", - }, - }, - { - name: "no brackets", - input: map[string]any{ - "test": "$HOST:$PORT", - }, - expected: map[string]any{ - "test": "127.0.0.1:4317", - }, - }, - { - name: "mix", - input: map[string]any{ - "test": "${HOST}:$PORT", - }, - expected: map[string]any{ - "test": "127.0.0.1:4317", - }, - }, - { - name: "reverse mix", - input: map[string]any{ - "test": "$HOST:${PORT}", - }, - expected: map[string]any{ - "test": "127.0.0.1:4317", - }, - }, - } - for _, tt := range testCases { - t.Run(tt.name, func(t *testing.T) { - conf := confmap.NewFromStringMap(tt.input) - require.NoError(t, createConverter().Convert(context.Background(), conf)) - assert.Equal(t, tt.expected, conf.ToStringMap()) - }) - } -} - -func NewTestConverter() (confmap.Converter, *observer.ObservedLogs) { - core, logs := observer.New(zapcore.InfoLevel) - conv := converter{loggedDeprecations: make(map[string]struct{}), logger: zap.New(core)} - return conv, logs -} - -func TestDeprecatedWarning(t *testing.T) { - msgTemplate := `Variable substitution using $VAR will be deprecated in favor of ${VAR} and ${env:VAR}, please update $%s` - t.Setenv("HOST", "127.0.0.1") - t.Setenv("PORT", "4317") - - t.Setenv("HOST_NAME", "127.0.0.2") - t.Setenv("HOSTNAME", "127.0.0.3") - - t.Setenv("BAD!HOST", "127.0.0.2") - - var testCases = []struct { - name string - input map[string]any - expectedOutput map[string]any - expectedWarnings []string - expectedError error - }{ - { - name: "no warning", - input: map[string]any{ - "test": "${HOST}:${PORT}", - }, - expectedOutput: map[string]any{ - "test": "127.0.0.1:4317", - }, - expectedWarnings: []string{}, - expectedError: nil, - }, - { - name: "malformed environment variable", - input: map[string]any{ - "test": "${BAD!HOST}", - }, - expectedOutput: map[string]any{ - "test": "blah", - }, - expectedWarnings: []string{}, - expectedError: fmt.Errorf("environment variable \"BAD!HOST\" has invalid name: must match regex %s", envvar.ValidationRegexp), - }, - { - name: "malformed environment variable number", - input: map[string]any{ - "test": "${2BADHOST}", - }, - expectedOutput: map[string]any{ - "test": "blah", - }, - expectedWarnings: []string{}, - expectedError: fmt.Errorf("environment variable \"2BADHOST\" has invalid name: must match regex %s", envvar.ValidationRegexp), - }, - { - name: "malformed environment variable unicode", - input: map[string]any{ - "test": "${😊BADHOST}", - }, - expectedOutput: map[string]any{ - "test": "blah", - }, - expectedWarnings: []string{}, - expectedError: fmt.Errorf("environment variable \"😊BADHOST\" has invalid name: must match regex %s", envvar.ValidationRegexp), - }, - } - - for _, tt := range testCases { - t.Run(tt.name, func(t *testing.T) { - conf := confmap.NewFromStringMap(tt.input) - conv, logs := NewTestConverter() - err := conv.Convert(context.Background(), conf) - assert.Equal(t, tt.expectedError, err) - if tt.expectedError == nil { - assert.Equal(t, tt.expectedOutput, conf.ToStringMap()) - } - assert.Equal(t, len(tt.expectedWarnings), len(logs.All())) - for i, variable := range tt.expectedWarnings { - errorMsg := fmt.Sprintf(msgTemplate, variable) - assert.Equal(t, errorMsg, logs.All()[i].Message) - } - }) - } -} - -func TestNewExpandConverterWithErrors(t *testing.T) { - var testCases = []struct { - name string // test case name (also file name containing config yaml) - expectedError error - }{ - { - name: "expand-list-error.yaml", - expectedError: fmt.Errorf("environment variable \"EXTRA_LIST_^VALUE_2\" has invalid name: must match regex %s", envvar.ValidationRegexp), - }, - { - name: "expand-list-map-error.yaml", - expectedError: fmt.Errorf("environment variable \"EXTRA_LIST_MAP_V#ALUE_2\" has invalid name: must match regex %s", envvar.ValidationRegexp), - }, - { - name: "expand-map-error.yaml", - expectedError: fmt.Errorf("environment variable \"EX#TRA\" has invalid name: must match regex %s", envvar.ValidationRegexp), - }, - } - - for _, tt := range testCases { - t.Run(tt.name, func(t *testing.T) { - conf, err := confmaptest.LoadConf(filepath.Join("testdata", "errors", tt.name)) - require.NoError(t, err, "Unable to get config") - - // Test that expanded configs are the same with the simple config with no env vars. - err = createConverter().Convert(context.Background(), conf) - - assert.Equal(t, tt.expectedError, err) - }) - } -} - -func createConverter() confmap.Converter { - // nolint - return NewFactory().Create(confmap.ConverterSettings{Logger: zap.NewNop()}) -} diff --git a/confmap/converter/expandconverter/go.mod b/confmap/converter/expandconverter/go.mod deleted file mode 100644 index 5d5368c414b..00000000000 --- a/confmap/converter/expandconverter/go.mod +++ /dev/null @@ -1,27 +0,0 @@ -// Deprecated: [v0.107.0] BASH-style env var expansion is deprecated. Use the `envprovider` instead to expand `${FOO}` and `${env:FOO}`. -// Using the expandconverter with `confmap.Resolver` will cause double escaping, so `$$$$` -> `$` instead of `$$`. -module go.opentelemetry.io/collector/confmap/converter/expandconverter - -go 1.22.0 - -require ( - github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/confmap v1.19.0 - go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.27.0 -) - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-viper/mapstructure/v2 v2.2.1 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.2 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) - -replace go.opentelemetry.io/collector/confmap => ../.. diff --git a/confmap/converter/expandconverter/go.sum b/confmap/converter/expandconverter/go.sum deleted file mode 100644 index 9eeb4481ac5..00000000000 --- a/confmap/converter/expandconverter/go.sum +++ /dev/null @@ -1,35 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= -github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.2 h1:I2rtLRqXRy1p01m/utEtpZSSA6dcJbgGVuE27kW2PzQ= -github.com/knadh/koanf/v2 v2.1.2/go.mod h1:Gphfaen0q1Fc1HTgJgSTC4oRX9R2R5ErYMZJy8fLJBo= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= -go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/confmap/converter/expandconverter/package_test.go b/confmap/converter/expandconverter/package_test.go deleted file mode 100644 index 39c682a02e2..00000000000 --- a/confmap/converter/expandconverter/package_test.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package expandconverter - -import ( - "testing" - - "go.uber.org/goleak" -) - -func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) -} diff --git a/confmap/converter/expandconverter/testdata/default-config.yaml b/confmap/converter/expandconverter/testdata/default-config.yaml deleted file mode 100644 index ee4ead5c11c..00000000000 --- a/confmap/converter/expandconverter/testdata/default-config.yaml +++ /dev/null @@ -1,5 +0,0 @@ -processors: - batch: -exporters: - otlp: - endpoint: "localhost:4317" diff --git a/confmap/converter/expandconverter/testdata/errors/expand-list-error.yaml b/confmap/converter/expandconverter/testdata/errors/expand-list-error.yaml deleted file mode 100644 index a5cc8ee4b72..00000000000 --- a/confmap/converter/expandconverter/testdata/errors/expand-list-error.yaml +++ /dev/null @@ -1,4 +0,0 @@ -test_map: - extra_list: - - "some list value_1" - - "${EXTRA_LIST_^VALUE_2}" diff --git a/confmap/converter/expandconverter/testdata/errors/expand-list-map-error.yaml b/confmap/converter/expandconverter/testdata/errors/expand-list-map-error.yaml deleted file mode 100644 index 1933594bd8a..00000000000 --- a/confmap/converter/expandconverter/testdata/errors/expand-list-map-error.yaml +++ /dev/null @@ -1,3 +0,0 @@ -test_map: - extra_list_map: - - { recv.1: "some list map value_1",recv.2: "${EXTRA_LIST_MAP_V#ALUE_2}" } diff --git a/confmap/converter/expandconverter/testdata/errors/expand-map-error.yaml b/confmap/converter/expandconverter/testdata/errors/expand-map-error.yaml deleted file mode 100644 index 67577789d1b..00000000000 --- a/confmap/converter/expandconverter/testdata/errors/expand-map-error.yaml +++ /dev/null @@ -1,2 +0,0 @@ -test_map: - extra: "${EX#TRA}" diff --git a/confmap/converter/expandconverter/testdata/expand-escaped-env.yaml b/confmap/converter/expandconverter/testdata/expand-escaped-env.yaml deleted file mode 100644 index d0882091054..00000000000 --- a/confmap/converter/expandconverter/testdata/expand-escaped-env.yaml +++ /dev/null @@ -1,15 +0,0 @@ -test_map: - # $$ -> escaped $ - recv.1: "$$MAP_VALUE_1" - # $$$ -> escaped $ + substituted env var - recv.2: "$$$MAP_VALUE_2" - # $$$$ -> two escaped $ - recv.3: "$$$$MAP_VALUE_3" - # escaped $ in the middle - recv.4: "some$${MAP_VALUE_4}text" - # two escaped $ - recv.5: "$${ONE}$${TWO}" - # trailing escaped $ - recv.6: "text$$" - # escaped $ alone - recv.7: "$$" diff --git a/confmap/converter/expandconverter/testdata/expand-with-all-env.yaml b/confmap/converter/expandconverter/testdata/expand-with-all-env.yaml deleted file mode 100644 index 004387c0ce2..00000000000 --- a/confmap/converter/expandconverter/testdata/expand-with-all-env.yaml +++ /dev/null @@ -1,11 +0,0 @@ -test_map: - extra: "$EXTRA" - extra_map: - recv.1: "$EXTRA_MAP_VALUE_1" - recv.2: "${EXTRA_MAP_VALUE_2}" - extra_list_map: - - { recv.1: "$EXTRA_LIST_MAP_VALUE_1",recv.2: "${EXTRA_LIST_MAP_VALUE_2}" } - extra_list: - - "$EXTRA_LIST_VALUE_1" - - "${EXTRA_LIST_VALUE_2}" - diff --git a/confmap/converter/expandconverter/testdata/expand-with-no-env.yaml b/confmap/converter/expandconverter/testdata/expand-with-no-env.yaml deleted file mode 100644 index fd4dd08210d..00000000000 --- a/confmap/converter/expandconverter/testdata/expand-with-no-env.yaml +++ /dev/null @@ -1,10 +0,0 @@ -test_map: - extra: "some string" - extra_map: - recv.1: "some map value_1" - recv.2: "some map value_2" - extra_list_map: - - { recv.1: "some list map value_1",recv.2: "some list map value_2" } - extra_list: - - "some list value_1" - - "some list value_2" diff --git a/confmap/converter/expandconverter/testdata/expand-with-partial-env.yaml b/confmap/converter/expandconverter/testdata/expand-with-partial-env.yaml deleted file mode 100644 index 9448a456bcd..00000000000 --- a/confmap/converter/expandconverter/testdata/expand-with-partial-env.yaml +++ /dev/null @@ -1,10 +0,0 @@ -test_map: - extra: "${EXTRA}" - extra_map: - recv.1: "${EXTRA_MAP_VALUE_1}" - recv.2: "some map value_2" - extra_list_map: - - { recv.1: "some list map value_1",recv.2: "${EXTRA_LIST_MAP_VALUE_2}" } - extra_list: - - "some list value_1" - - "$EXTRA_LIST_VALUE_2" diff --git a/versions.yaml b/versions.yaml index 664af4d7198..11e0a17fd56 100644 --- a/versions.yaml +++ b/versions.yaml @@ -31,7 +31,6 @@ module-sets: - go.opentelemetry.io/collector/component - go.opentelemetry.io/collector/component/componenttest - go.opentelemetry.io/collector/component/componentstatus - - go.opentelemetry.io/collector/confmap/converter/expandconverter - go.opentelemetry.io/collector/config/configauth - go.opentelemetry.io/collector/config/configgrpc - go.opentelemetry.io/collector/config/confighttp