-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Issue enforcing quoted values in config #10659
Comments
I believe #10618 would fix this, I will add a test on this specific case. |
@MovieStoreGuy I was not able to reproduce this on
receivers:
nop:
processors:
resource:
attributes:
- key: build.version
value: "${env:BUILT_TS}"
action: insert
exporters:
nop:
service:
telemetry:
logs:
level: debug
pipelines:
traces:
receivers:
- nop
processors:
- resource
exporters:
- nop And in the confmap e2e tests the following tests pass:
|
I believe this is the root cause of the issue
When the env var being expanded is the entire string, it is expanded and the returned value and it's type is kept as is. I agree that @mx-psi PR will fix the issue. In the meantime you can use |
…ts (#11241) #### Description This addresses #10659. In #10800 we removed restrictions on the types that can be allowed if expanded but in our case, this still fails because of the checks existing in `provider.checkRawConfType()` This adds `time.Time` as a type in the `provider.checkRawConfType()` instead of removing it completely. #### Link to tracking issue Fixes #10659 <!--Describe what testing was performed and which tests were added.--> #### Testing - added a test case to handle time formats in provider.go and expand.go - added an e2e test case to handle time formats
…ts (open-telemetry#11241) #### Description This addresses open-telemetry#10659. In open-telemetry#10800 we removed restrictions on the types that can be allowed if expanded but in our case, this still fails because of the checks existing in `provider.checkRawConfType()` This adds `time.Time` as a type in the `provider.checkRawConfType()` instead of removing it completely. #### Link to tracking issue Fixes open-telemetry#10659 <!--Describe what testing was performed and which tests were added.--> #### Testing - added a test case to handle time formats in provider.go and expand.go - added an e2e test case to handle time formats
…ts (open-telemetry#11241) #### Description This addresses open-telemetry#10659. In open-telemetry#10800 we removed restrictions on the types that can be allowed if expanded but in our case, this still fails because of the checks existing in `provider.checkRawConfType()` This adds `time.Time` as a type in the `provider.checkRawConfType()` instead of removing it completely. #### Link to tracking issue Fixes open-telemetry#10659 <!--Describe what testing was performed and which tests were added.--> #### Testing - added a test case to handle time formats in provider.go and expand.go - added an e2e test case to handle time formats
Describe the bug
When providing a configuration that uses the
env
provider, it does not preserve the quotes around the"${env:...}"
.This means when a complaint time RFC string is supplied, it gets converted into a
time.Time
value instead of the expected string, which then stops the config from being valid.Steps to reproduce
a.
export BUILT_TS="2006-01-02T15:04:05Z07:00"
a.
value : "${env:BUILT_TS}"
What did you expect to see?
Considering the provider is in quotes, it should not strip those values
What did you see instead?
Upon running the collector with the provider configuration, the error is show as:
What version did you use?
v0.105.0
What config did you use?
Environment
Linux, go v1.23.4
Additional context
I've tried a few different combinations, but this currently works in
v0.103.0
but upgrading tov0.105.0
surfaced this.I've also tried:
The text was updated successfully, but these errors were encountered: