Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add glob config provider #713

Merged
merged 3 commits into from
Sep 20, 2022
Merged

feat: add glob config provider #713

merged 3 commits into from
Sep 20, 2022

Conversation

swiatekm
Copy link

@swiatekm swiatekm commented Aug 30, 2022

Add a glob config provider and use it in the build. See #708 for the rationale and semantics.

This PR is likely easier to review commit-by-commit, as they're almost completely independent. I'm submitting it as a single PR because I think it's easier to understand with the added context, but if this turns out to hurt more than it helps, I can resubmit separately.

The glob provider is added as a separate package and should be relatively self-explanatory.

The process of adding it to the build is a bit convoluted. We can pass a CollectorSettings struct with a custom ConfigProvider to add our glob provider. However, creating this ConfigProvider requires knowing the config locations, and we need to parse command-line flags. If we could hook into the existing Cobra command, this could be much easier, but as is, we use a workaround to parse what we need.

We unfortunately also need to modify the output of otelcolbuilder, which is done in the Makefile by patching main.go and adding an additional replace clause to go.mod.

@github-actions github-actions bot added documentation Improvements or additions to documentation go labels Aug 30, 2022
@swiatekm swiatekm force-pushed the dev-build/globprovider branch 2 times, most recently from 97b066d to b3cd56a Compare August 31, 2022 14:18
@swiatekm swiatekm marked this pull request as ready for review August 31, 2022 14:32
@swiatekm swiatekm requested a review from a team as a code owner August 31, 2022 14:32
CHANGELOG.md Outdated Show resolved Hide resolved
@swiatekm swiatekm force-pushed the dev-build/globprovider branch from b3cd56a to 156f68c Compare September 2, 2022 11:04
@swiatekm swiatekm force-pushed the dev-build/globprovider branch from 156f68c to 3bcac2d Compare September 20, 2022 08:08
@swiatekm swiatekm enabled auto-merge (rebase) September 20, 2022 08:09
@swiatekm swiatekm merged commit 19cdef6 into main Sep 20, 2022
@swiatekm swiatekm deleted the dev-build/globprovider branch September 20, 2022 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation go
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants