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

Environment variable resolution is broken when SPLUNK_DOUBLE_DOLLAR_CONFIG_SOURCE_COMPATIBLE is false #2628

Closed
crobert-1 opened this issue Feb 27, 2023 · 2 comments

Comments

@crobert-1
Copy link
Contributor

crobert-1 commented Feb 27, 2023

Versions: v0.71.0+

This is a result of this change.. The current impact is shown by the TestIncompatibleExpandedDollarSignsViaEnvConfigSource integration test.

Failing config section:

          - action: add_label
            new_label: double-dollar
            new_value: $${env:AN_ENVVAR}-suffix

The config resolution logic attempts to resolve the environment variable successfully, but rather than setting a config map up with the key value of the environment variable name as key, and environment value as the value, it simply creates a string of the environment variable value. This results in a panic when attempting to start the collector because it's attempting to merge a map with a string.

Panic location here.

Possible solutions include:

  1. replacing the wrapped config provided entirely and just using core's.
  2. Modifying the Retrieve method's logic to properly handle environment variables, and plain strings to merge them into a map. We'd have to be pretty careful with the second option as the config resolution logic is pretty involved, so just modifying values would be pretty risky.
@crobert-1
Copy link
Contributor Author

This line is what ends up converting the environment variable value to a string of its own value. This call could either be replaced, modified, or the result could be edited to be the proper format. This would be if we chose option 2 in the description.

This is the Retrieve method that properly gets the env variable value. This method has an equivalent for file sources, HTTP, etc. These would all have to be properly handled if the second option is chosen.

crobert-1 added a commit that referenced this issue Feb 28, 2023
* Prepare for v0.71.0 release

Includes updating dependencies, fix breaking changes,
update smart agent and java instrumentation release
references. Update Nomad testing with proper versions.
Skip an integration test due to issue #2628
@rmfitzpatrick
Copy link
Contributor

Resolved by 70b75c7

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

No branches or pull requests

2 participants