Skip to content

Commit

Permalink
[chore] make update-otel 812f462 (#17075)
Browse files Browse the repository at this point in the history
- componenttest.NopFactories -> otelcoltest.NopFactories
- component.Factories -> otelcol.Factories

Signed-off-by: Alex Boten <[email protected]>

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
Alex Boten authored Dec 16, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 5c2e57e commit b3d6f1a
Showing 417 changed files with 3,327 additions and 3,320 deletions.
4 changes: 2 additions & 2 deletions cmd/configschema/cfgmetadatagen/cfgmetadatagen/cli.go
Original file line number Diff line number Diff line change
@@ -18,15 +18,15 @@ import (
"fmt"
"reflect"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/otelcol"
"gopkg.in/yaml.v2"

"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema"
)

// GenerateFiles is the entry point for cfgmetadatagen. Component factories are
// passed in so it can be used by other distros.
func GenerateFiles(factories component.Factories, sourceDir string, outputDir string) error {
func GenerateFiles(factories otelcol.Factories, sourceDir string, outputDir string) error {
dr := configschema.NewDirResolver(sourceDir, configschema.DefaultModule)
writer := newMetadataFileWriter(outputDir)
configs := configschema.GetAllCfgInfos(factories)
5 changes: 3 additions & 2 deletions cmd/configschema/configs.go
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ import (
"fmt"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/otelcol"
)

const (
@@ -40,7 +41,7 @@ type CfgInfo struct {

// GetAllCfgInfos accepts a Factories struct, then creates and returns a CfgInfo
// for each of its components.
func GetAllCfgInfos(components component.Factories) []CfgInfo {
func GetAllCfgInfos(components otelcol.Factories) []CfgInfo {
var out []CfgInfo
for _, f := range components.Receivers {
out = append(out, CfgInfo{
@@ -76,7 +77,7 @@ func GetAllCfgInfos(components component.Factories) []CfgInfo {
// GetCfgInfo accepts a Factories struct, then creates and returns the default
// config for the component specified by the passed-in componentType and
// componentName.
func GetCfgInfo(components component.Factories, componentType, componentName string) (CfgInfo, error) {
func GetCfgInfo(components otelcol.Factories, componentType, componentName string) (CfgInfo, error) {
t := component.Type(componentName)
switch componentType {
case receiver:
4 changes: 2 additions & 2 deletions cmd/configschema/configs_test.go
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/otelcol"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/components"
)
@@ -75,7 +75,7 @@ func TestGetConfig(t *testing.T) {
}
}

func testComponents() component.Factories {
func testComponents() otelcol.Factories {
cmps, err := components.Components()
if err != nil {
panic(err)
10 changes: 5 additions & 5 deletions cmd/configschema/docsgen/docsgen/cli.go
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ import (
"strings"
"text/template"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/otelcol"

"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema"
)
@@ -34,7 +34,7 @@ const mdFileName = "config.md"
// CLI is the entrypoint for this package's functionality. It handles command-
// line arguments for the docsgen executable and produces config documentation
// for the specified components.
func CLI(factories component.Factories, dr configschema.DirResolver) {
func CLI(factories otelcol.Factories, dr configschema.DirResolver) {
tableTmpl, err := tableTemplate()
if err != nil {
panic(err)
@@ -44,7 +44,7 @@ func CLI(factories component.Factories, dr configschema.DirResolver) {
}

func handleCLI(
factories component.Factories,
factories otelcol.Factories,
dr configschema.DirResolver,
tableTmpl *template.Template,
writeFile writeFileFunc,
@@ -74,7 +74,7 @@ func printLines(wr io.Writer, lines ...string) {
func allComponents(
dr configschema.DirResolver,
tableTmpl *template.Template,
factories component.Factories,
factories otelcol.Factories,
writeFile writeFileFunc,
) {
configs := configschema.GetAllCfgInfos(factories)
@@ -86,7 +86,7 @@ func allComponents(
func singleComponent(
dr configschema.DirResolver,
tableTmpl *template.Template,
factories component.Factories,
factories otelcol.Factories,
componentType, componentName string,
writeFile writeFileFunc,
) {
6 changes: 3 additions & 3 deletions cmd/configschema/docsgen/docsgen/cli_test.go
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/otelcol"

"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/components"
@@ -90,13 +90,13 @@ func TestHandleCLI_All(t *testing.T) {
assert.NotNil(t, writer.fileContents)
}

func defaultComponents(t *testing.T) component.Factories {
func defaultComponents(t *testing.T) otelcol.Factories {
factories, err := components.Components()
require.NoError(t, err)
return factories
}

func testHandleCLI(t *testing.T, cs component.Factories, wr *fakeFilesystemWriter, args []string) {
func testHandleCLI(t *testing.T, cs otelcol.Factories, wr *fakeFilesystemWriter, args []string) {
stdoutWriter := &fakeIOWriter{}
tmpl := testTemplate(t)
dr := configschema.NewDirResolver(filepath.Join("..", "..", "..", ".."), configschema.DefaultModule)
36 changes: 21 additions & 15 deletions cmd/configschema/go.mod
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib v0.0.0-00010101000000-000000000000
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver v0.67.0
github.com/stretchr/testify v1.8.1
go.opentelemetry.io/collector v0.67.1-0.20221212223545-7cb2d7622deb
go.opentelemetry.io/collector/component v0.67.1-0.20221212223545-7cb2d7622deb
go.opentelemetry.io/collector/receiver/otlpreceiver v0.67.1-0.20221212223545-7cb2d7622deb
go.opentelemetry.io/collector v0.67.1-0.20221213235724-812f462b3182
go.opentelemetry.io/collector/component v0.67.1-0.20221213235724-812f462b3182
go.opentelemetry.io/collector/receiver/otlpreceiver v0.67.1-0.20221213235724-812f462b3182
golang.org/x/mod v0.7.0
golang.org/x/text v0.5.0
gopkg.in/yaml.v2 v2.4.0
@@ -32,6 +32,7 @@ require (
code.cloudfoundry.org/go-diodes v0.0.0-20211115184647-b584dd5df32c // indirect
code.cloudfoundry.org/go-loggregator v7.4.0+incompatible // indirect
code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78 // indirect
contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect
contrib.go.opencensus.io/exporter/stackdriver v0.13.14 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
@@ -235,6 +236,7 @@ require (
github.com/hetznercloud/hcloud-go v1.35.3 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6 // indirect
github.com/influxdata/influxdb-observability/common v0.2.33 // indirect
github.com/influxdata/influxdb-observability/influx2otel v0.2.33 // indirect
@@ -510,6 +512,7 @@ require (
github.com/prometheus/common/sigv4 v0.1.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/prometheus v0.40.6 // indirect
github.com/prometheus/statsd_exporter v0.22.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/relvacode/iso8601 v1.1.0 // indirect
github.com/rs/cors v1.8.2 // indirect
@@ -530,6 +533,7 @@ require (
github.com/soheilhy/cmux v0.1.5 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.6.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
@@ -563,22 +567,24 @@ require (
go.mongodb.org/atlas v0.19.0 // indirect
go.mongodb.org/mongo-driver v1.11.1 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/collector/confmap v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/consumer v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/exporter/loggingexporter v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/exporter/otlpexporter v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/exporter/otlphttpexporter v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/extension/ballastextension v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/extension/zpagesextension v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/featuregate v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/pdata v1.0.0-rc1.0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/processor/batchprocessor v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/semconv v0.67.1-0.20221212223545-7cb2d7622deb // indirect
go.opentelemetry.io/collector/confmap v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/consumer v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/exporter/loggingexporter v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/exporter/otlpexporter v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/exporter/otlphttpexporter v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/extension/ballastextension v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/extension/zpagesextension v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/featuregate v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/pdata v1.0.0-rc1.0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/processor/batchprocessor v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/collector/semconv v0.67.1-0.20221213235724-812f462b3182 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.37.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.12.0 // indirect
go.opentelemetry.io/contrib/zpages v0.37.0 // indirect
go.opentelemetry.io/otel v1.11.2 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.34.0 // indirect
go.opentelemetry.io/otel/metric v0.34.0 // indirect
go.opentelemetry.io/otel/sdk v1.11.2 // indirect
go.opentelemetry.io/otel/sdk/metric v0.34.0 // indirect
Loading

0 comments on commit b3d6f1a

Please sign in to comment.