Closed
Description
Component(s)
cmd/mdatagen
What happened?
Describe the bug
I have a package where the directory name is not the same as the package name. (Yes, I will fix this too, but this package compiles fine otherwise.) mdatagen
generates files assuming the directory name is the package name. In places where this is not true, mdatagen
silently generates invalid files.
Unfortunately, when it does, go list -f
now reports an error, and mdatagen
doesn't report the error, just a string saying "exit status 1".
Steps to reproduce
- Create two go files in the same directory with different package names, and a minimal
metadata.yaml
file - Run
mdatagen metadata.yaml
- Observe
failed loading metadata.yaml: exit status 1
(The PR will have a test case replicating this.)
What did you expect to see?
- I expected to see the command that was executed; I didn't anticipate it would run a
go
command, so I presumed that themdatagen
itself was returning exit status 1 for some reason, or that mymetadata.yaml
file was in error. - I expected to see the stderr of the command.
What did you see instead?
failed loading metadata.yaml: exit status 1
Collector version
v0.128.0 and v0.109.0
Environment information
Environment
Mac M1 Sequoia 15.5 but should be independent of OS.
OpenTelemetry Collector configuration
Log output
`failed loading metadata.yaml: exit status 1`
Additional context
No response