-
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
[confmap] Unify behavior of ${env:ENV}
and ${ENV}
#10161
Comments
${env:ENV} and
${ENV}`${env:ENV}
and ${ENV}
@mx-psi I see a couple approaches.
I've experimented with 2 and think it would be workable. It would take care of this issue and #8215 at once. It did feel a little messy but there are probably ways to share code between the 2 places. I would also be ok with option 4, as it provides a lot of flexibility. Option 3 is pretty simple as well. |
Option 4 feels the cleanest to me. I think we should do it without the awareness of any of the Providers by prepending the default schema to the URI when the URI is given to the Provider, like the Resolver currently does with files passed to |
Ya that would work. I don't love the idea of messing with the incoming values, but if we already have precedence I can be ok with it.
I think this is an option, but not required for 1.0 |
Agreed that option 4 feels like the cleanest. If we go with (4), for now I don't think we need to make this configurable anywhere other than the Go API, but we can open the door to make this configurable in the future by end-users |
Agreed. I'll start work on option 4. I try to do this and #7111 in one. |
#### Description This PR adds support for expanding `${}` syntax when no schema is provided by allowing Resolver to use a default provider. In a followup PR I'll update otelcol with a feature gate that allow switching between a default envProvider and the expandconverter. #### Link to tracking issue Related to #10161 Related to #7111 #### Testing Added unit tests #### Documentation Added godoc strings --------- Co-authored-by: Evan Bradley <[email protected]>
#### Description This PR adds support for expanding `${}` syntax when no schema is provided by allowing Resolver to use a default provider. In a followup PR I'll update otelcol with a feature gate that allow switching between a default envProvider and the expandconverter. #### Link to tracking issue Related to open-telemetry#10161 Related to open-telemetry#7111 #### Testing Added unit tests #### Documentation Added godoc strings --------- Co-authored-by: Evan Bradley <[email protected]>
#### Description This PR adds a feature gate that will handle transitioning users away from expandconverter, specifically expanding `$VAR` syntax. The wholistic strategy is: 1. create a new feature gate, `confmap.unifyEnvVarExpansion`, that will be the single feature gate to manage unifying collector configuraiton resolution. 2. Update expandconverter to return an error if the feature gate is enabled and it is about to expand `$VAR` syntax. 3. Update `otelcol.NewCommand` to set a `DefaultScheme="env"` when the feature gate is enabled and no `DefaultScheme` is set, this handles `${VAR}` syntax. 4. Separately, deprecate `expandconverter`. 5. Follow a normal feature gate cycle. 6. Removed the `confmap.unifyEnvVarExpansion` feature gates and `expandconverter` at the same time Supersedes #10259 #### Link to tracking issue Related to #10161 Related to #8215 Related to #7111 #### Testing Unit tests
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Moves confmap.unifyEnvVarExpansion to beta. This means the collector will, by default, use the env var provider to expand `${FOO}` synatx and will error if the expandconverter is used to expand `$FOO` syntax. <!-- Issue number if applicable --> #### Link to tracking issue Related to #10161 Related to #8215 Related to #7111 --------- Co-authored-by: Pablo Baeyens <[email protected]>
…0508) #### Description This PR promotes the `confmap.unifyEnvVarExpansion` feature gate to stable and sets a `ToVersion` of `v0.106.0`, anticipating that the gate be completely removed in that version. We should weigh if switching the Stable should be done in `v0.105.0` or if it needs more time in `Beta` to give users more time to switch. Delaying promotion to `Stable` delays confmap 1.0. If we merge this we need to commit to merging #10510 in the same release. #### Link to tracking issue Related to #10161 Related to #7111 Related to #8215 --------- Co-authored-by: Evan Bradley <[email protected]>
As decided on #9854, we want to unify the behavior of
${env:ENV}
and${ENV}
. Currently, each has a different behavior: the${ENV}
syntax does not do any YAML parsing, while the${env:ENV}
syntax does parse the contents as YAML. We want to unify both and make them have the same behavior, described in RFC #9854.One approach for this is to have some 'default' confmap provider used by the
${..}
syntax, and control what provider is used (aexpandconverter
provider or theenv
provider) through a feature gate.cc @TylerHelmuth
The text was updated successfully, but these errors were encountered: