Skip to content

[cmd/builder] Provide better error or have main.go template be conditional on otelcol_version #9019

Open
@mx-psi

Description

Describe the bug

If building a Collector with otelcol_version set to v0.88.0 or below with a builder with v0.89.0 or above it will fail to build.

Steps to reproduce

See https://github.com/kenfinnigan/otel-collector-builder-reproducer

What did you expect to see?

The Collector can be built successfully or, alternatively, a clear error message tells me what to do.

What did you see instead?

./main.go:20:70: cannot use components (value of type func() (otelcol.Factories, error)) as otelcol.Factories value in struct literal
make: *** [Makefile:52: otelcontribcolbuilder] Error 1

Additional context

This happens because #8478 broke builds for otelcol_version lower than v0.89.0. On #8713 there is an example of doing this kind of change while avoiding breakage for older Collector versions. I guess the question remains on how much compatibility we want to have with older versions, but since this is easy to handle, I think we should keep compatibility for now.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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