From 91d9feef2ec5da9f89653d23e3b6383859bc0cb9 Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Mon, 2 Dec 2024 22:21:55 -0500 Subject: [PATCH] [chore] additional changes --- receiver/githubreceiver/config.go | 5 ++--- receiver/githubreceiver/factory_test.go | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/receiver/githubreceiver/config.go b/receiver/githubreceiver/config.go index c446ec6590a4..adad61f2a069 100755 --- a/receiver/githubreceiver/config.go +++ b/receiver/githubreceiver/config.go @@ -47,7 +47,6 @@ var ( _ component.Config = (*Config)(nil) _ confmap.Unmarshaler = (*Config)(nil) - // TODO: Adjust & maybe move to factory alongside other errors errMissingEndpointFromConfig = errors.New("missing receiver server endpoint from config") errReadTimeoutExceedsMaxValue = errors.New("the duration specified for read_timeout exceeds the maximum allowed value of 10s") errWriteTimeoutExceedsMaxValue = errors.New("the duration specified for write_timeout exceeds the maximum allowed value of 10s") @@ -59,6 +58,8 @@ var ( func (cfg *Config) Validate() error { var errs error + // For now, scrapers are required to be defined in the config. As tracing + // and other signals are added, this requirement will change. if len(cfg.Scrapers) == 0 { errs = multierr.Append(errs, errRequireOneScraper) } @@ -69,8 +70,6 @@ func (cfg *Config) Validate() error { errs = multierr.Append(errs, errMissingEndpointFromConfig) } - // If a user defines a custom read/write timeout there is a maximum value - // of 10s imposed here. if cfg.WebHook.ServerConfig.ReadTimeout > maxReadWriteTimeout { errs = multierr.Append(errs, errReadTimeoutExceedsMaxValue) } diff --git a/receiver/githubreceiver/factory_test.go b/receiver/githubreceiver/factory_test.go index 4d6aecf0aa78..6fbf6b7ef14e 100644 --- a/receiver/githubreceiver/factory_test.go +++ b/receiver/githubreceiver/factory_test.go @@ -31,7 +31,6 @@ func TestCreateDefaultConfig(t *testing.T) { func TestCreateReceiver(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig().(*Config) - // cfg.WebHook.Endpoint = "localhost:8080" tReceiver, err := factory.CreateTraces(context.Background(), creationSet, cfg, consumertest.NewNop()) assert.NoError(t, err)