diff --git a/cmd/checkapi/allowlist.txt b/cmd/checkapi/allowlist.txt index b791c2c59028..f63baf5214a7 100644 --- a/cmd/checkapi/allowlist.txt +++ b/cmd/checkapi/allowlist.txt @@ -1,5 +1,4 @@ connector/servicegraphconnector -extension/encoding extension/observer processor/servicegraphprocessor receiver/kafkareceiver diff --git a/cmd/checkapi/main.go b/cmd/checkapi/main.go index 609d1fd55991..50d2bff18a71 100644 --- a/cmd/checkapi/main.go +++ b/cmd/checkapi/main.go @@ -172,12 +172,13 @@ func walkFolder(folder string, componentType string) error { return nil } + if len(result.Functions) == 0 { + return nil + } if len(result.Functions) > 1 { return fmt.Errorf("%s has more than one function: %q", folder, strings.Join(fnNames, ",")) } - if len(result.Functions) == 0 { - return fmt.Errorf("%s has no functions defined", folder) - } + newFactoryFn := result.Functions[0] if newFactoryFn.Name != "NewFactory" { return fmt.Errorf("%s does not define a NewFactory function", folder)