diff --git a/.changelog/1385.changed.txt b/.changelog/1385.changed.txt new file mode 100644 index 0000000000..e909a9b8f0 --- /dev/null +++ b/.changelog/1385.changed.txt @@ -0,0 +1 @@ +Removed OpAMP extension remote configuration directory readable validation. diff --git a/pkg/extension/opampextension/config.go b/pkg/extension/opampextension/config.go index 2df8e652f2..7d9b75285e 100644 --- a/pkg/extension/opampextension/config.go +++ b/pkg/extension/opampextension/config.go @@ -16,8 +16,6 @@ package opampextension import ( "errors" - "fmt" - "os" "github.com/oklog/ulid/v2" "go.opentelemetry.io/collector/component" @@ -63,10 +61,5 @@ func (cfg *Config) Validate() error { return errors.New("opamp remote_configuration_directory must be provided") } - d := cfg.RemoteConfigurationDirectory - if _, err := os.Stat(d); err != nil { - return fmt.Errorf("opamp remote_configuration_directory %s must be readable: %v", d, err) - } - return nil } diff --git a/pkg/extension/opampextension/config_test.go b/pkg/extension/opampextension/config_test.go index 7d86aaf4b2..92a3888b5e 100644 --- a/pkg/extension/opampextension/config_test.go +++ b/pkg/extension/opampextension/config_test.go @@ -17,7 +17,6 @@ package opampextension import ( "os" "path/filepath" - "strings" "testing" "github.com/stretchr/testify/assert" @@ -63,10 +62,6 @@ func TestConfigValidate(t *testing.T) { require.Error(t, err) assert.Equal(t, "opamp remote_configuration_directory must be provided", err.Error()) - cfg.RemoteConfigurationDirectory = "/tmp/opamp.d" - err = cfg.Validate() - assert.True(t, strings.HasPrefix(err.Error(), "opamp remote_configuration_directory /tmp/opamp.d must be readable:")) - d, err := os.MkdirTemp("", "opamp.d") assert.NoError(t, err) defer os.RemoveAll(d)