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

Allow setting both SPLUNK_CONFIG and --config with priority given to --config #450

Merged
merged 3 commits into from
Jun 10, 2021

Conversation

rmfitzpatrick
Copy link
Contributor

Currently it's forbidden to set both SPLUNK_CONFIG and provide the --config cmdline options for our distribution. This is a little unexpected given cli tools generally allow redundant options while giving priority to command line options and falling back to environment variables. The current system makes it relatively inconvenient to update startup arguments as changing or clearing the environment variable is also required, which can sometimes be more difficult than updating the cmdline args.

These changes ease the restriction and give priority to the --config option with clear logging of which config will be used. They also provide more context when default config locations are used and required env vars aren't set.

Also including necessary testutils changes for added integration tests.

Copy link
Contributor

@pmcollins pmcollins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just whitespace nits :-)

cmd/otelcol/main.go Outdated Show resolved Hide resolved
tests/general/container_test.go Outdated Show resolved Hide resolved
tests/testutils/collector_container.go Outdated Show resolved Hide resolved
@rmfitzpatrick rmfitzpatrick force-pushed the start_env_var_fixup branch from 626e348 to d4e4b27 Compare June 4, 2021 13:59
@rmfitzpatrick
Copy link
Contributor Author

@flands, mind weighing in as the original author?

@rmfitzpatrick rmfitzpatrick merged commit 07da8d8 into main Jun 10, 2021
@delete-merged-branch delete-merged-branch bot deleted the start_env_var_fixup branch June 10, 2021 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants