Skip to content

Commit

Permalink
By default disable the confmap.strictlyTypedInput feature gate until …
Browse files Browse the repository at this point in the history
…OTL-2877 is completed and after open-telemetry/opentelemetry-collector#5228
  • Loading branch information
jvoravong committed Jul 23, 2024
1 parent 5766073 commit 680c11b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion internal/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ var DefaultAgentConfigWindows = func() string {
return filepath.Clean(path)
}()

var defaultFeatureGates = []string{}
var defaultFeatureGates = []string{
"-confmap.strictlyTypedInput", // TODO: Remove as part of OTL-2877 and after https://github.com/open-telemetry/opentelemetry-collector/issues/5228
}

type Settings struct {
discovery *discovery.Provider
Expand Down
12 changes: 6 additions & 6 deletions internal/settings/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func TestNewSettingsNoConvertConfig(t *testing.T) {
"splunk.property:splunk.discovery.receiver.receiver-type/name.config.field.two=val.two",
}, settings.ResolverURIs())
require.Equal(t, 2, len(settings.ConfMapConverterFactories()))
require.Equal(t, []string{"--feature-gates", "foo", "--feature-gates", "-bar"}, settings.ColCoreArgs())
require.Equal(t, []string{"--feature-gates", "foo", "--feature-gates", "-bar", "--feature-gates", "-confmap.strictlyTypedInput"}, settings.ColCoreArgs())
}

func TestNewSettingsConvertConfig(t *testing.T) {
Expand All @@ -157,7 +157,7 @@ func TestNewSettingsConvertConfig(t *testing.T) {

require.Equal(t, []string{configPath, anotherConfigPath}, settings.ResolverURIs())
require.Equal(t, 12, len(settings.ConfMapConverterFactories()))
require.Equal(t, []string{"--feature-gates", "foo", "--feature-gates", "-bar"}, settings.ColCoreArgs())
require.Equal(t, []string{"--feature-gates", "foo", "--feature-gates", "-bar", "--feature-gates", "-confmap.strictlyTypedInput"}, settings.ColCoreArgs())
}

func TestSplunkConfigYamlUtilizedInResolverURIs(t *testing.T) {
Expand All @@ -184,7 +184,7 @@ func TestNewSettingsWithValidate(t *testing.T) {
settings, err := New([]string{"validate"})
require.NoError(t, err)
require.NotNil(t, settings)
require.Equal(t, []string{"validate"}, settings.ColCoreArgs())
require.Equal(t, []string{"--feature-gates", "-confmap.strictlyTypedInput", "validate"}, settings.ColCoreArgs())
}

func TestCheckRuntimeParams_Default(t *testing.T) {
Expand Down Expand Up @@ -338,9 +338,9 @@ func TestSetDefaultEnvVarsSetsInterfaceFromConfigOption(t *testing.T) {
func TestSetDefaultFeatureGatesRespectsOverrides(t *testing.T) {
t.Cleanup(setRequiredEnvVars(t))
for _, args := range [][]string{
{"--feature-gates", "some-gate", "--feature-gates", "telemetry.useOtelForInternalMetrics", "--feature-gates", "another-gate"},
{"--feature-gates", "some-gate", "--feature-gates", "+telemetry.useOtelForInternalMetrics", "--feature-gates", "another-gate"},
{"--feature-gates", "some-gate", "--feature-gates", "-telemetry.useOtelForInternalMetrics", "--feature-gates", "another-gate"},
{"--feature-gates", "some-gate", "--feature-gates", "telemetry.useOtelForInternalMetrics", "--feature-gates", "another-gate", "--feature-gates", "+confmap.strictlyTypedInput"},
{"--feature-gates", "some-gate", "--feature-gates", "+telemetry.useOtelForInternalMetrics", "--feature-gates", "another-gate", "--feature-gates", "+confmap.strictlyTypedInput"},
{"--feature-gates", "some-gate", "--feature-gates", "-telemetry.useOtelForInternalMetrics", "--feature-gates", "another-gate", "--feature-gates", "+confmap.strictlyTypedInput"},
} {
t.Run(strings.Join(args, " "), func(t *testing.T) {
settings, err := New(args)
Expand Down
4 changes: 2 additions & 2 deletions tests/general/default_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestDefaultGatewayConfig(t *testing.T) {
"batch": nil,
"memory_limiter": map[string]any{
"check_interval": "2s",
"limit_mib": 460,
"limit_mib": "460",
},
"resourcedetection/internal": map[string]any{
"detectors": []any{"gcp", "ecs", "ec2", "azure", "system"},
Expand Down Expand Up @@ -297,7 +297,7 @@ func TestDefaultAgentConfig(t *testing.T) {
"batch": nil,
"memory_limiter": map[string]any{
"check_interval": "2s",
"limit_mib": 460,
"limit_mib": "460",
},
"resourcedetection": map[string]any{"detectors": []any{"gcp", "ecs", "ec2", "azure", "system"},
"override": true,
Expand Down

0 comments on commit 680c11b

Please sign in to comment.