Skip to content

[cmd/mdatagen]: go list output missing #13205

Closed
@jeffalder

Description

@jeffalder

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

  1. Create two go files in the same directory with different package names, and a minimal metadata.yaml file
  2. Run mdatagen metadata.yaml
  3. 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 the mdatagen itself was returning exit status 1 for some reason, or that my metadata.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions