Skip to content

Commit

Permalink
[chore] Fix configschema uses of component.Type (#31263)
Browse files Browse the repository at this point in the history
**Description:** Fixes configschema uses of `component.Type`

**Link to tracking Issue:**
open-telemetry/opentelemetry-collector/issues/9208
  • Loading branch information
mx-psi committed Feb 14, 2024
1 parent 31d5f56 commit b7aea84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ import (

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

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

func TestMetadataFileWriter(t *testing.T) {
tempDir := t.TempDir()
w := newMetadataFileWriter(tempDir)
err := w.write(configschema.CfgInfo{Group: "mygroup", Type: "mytype"}, []byte("hello"))
err := w.write(configschema.CfgInfo{Group: "mygroup", Type: component.MustNewType("mytype")}, []byte("hello"))
require.NoError(t, err)
file, err := os.Open(filepath.Join(tempDir, "mygroup", "mytype.yaml"))
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/configschema/docsgen/docsgen/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func writeConfigDoc(
panic(err)
}

mdBytes := renderHeader(string(ci.Type), ci.Group, f.Doc)
mdBytes := renderHeader(ci.Type.String(), ci.Group, f.Doc)

f.Name = typeToName(f.Type)

Expand Down

0 comments on commit b7aea84

Please sign in to comment.