Skip to content

Commit

Permalink
[chore] additional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adrielp committed Dec 3, 2024
1 parent 5b61824 commit 91d9fee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions receiver/githubreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down
1 change: 0 additions & 1 deletion receiver/githubreceiver/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 91d9fee

Please sign in to comment.