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

[confmap] Support expansion for environment variables with time formats #11241

Merged

Conversation

irisgve
Copy link
Contributor

@irisgve irisgve commented Sep 23, 2024

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

Testing

  • added a test case to handle time formats in provider.go and expand.go
  • added an e2e test case to handle time formats

@irisgve irisgve marked this pull request as ready for review September 23, 2024 08:06
@irisgve irisgve requested a review from a team as a code owner September 23, 2024 08:06
@irisgve irisgve requested a review from codeboten September 23, 2024 08:06
Copy link
Contributor

@MovieStoreGuy MovieStoreGuy left a comment

Choose a reason for hiding this comment

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

The changes make sense, the only thing I am unsure of is why the check existed.

@MovieStoreGuy
Copy link
Contributor

You'll also need to create a change log entry for this as well with make chlog-new and fill in the template :)

@irisgve irisgve force-pushed the support-time-envvar-expansion branch from de250a6 to d12a7b4 Compare September 23, 2024 10:47
confmap/provider.go Outdated Show resolved Hide resolved
@irisgve irisgve force-pushed the support-time-envvar-expansion branch from adec838 to 0b2af62 Compare September 23, 2024 21:33
Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

I feel like adding the time.Time case to the error check is the proper way to handle this. @mx-psi do you agree?

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.52%. Comparing base (5cc717d) to head (b75ab86).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11241   +/-   ##
=======================================
  Coverage   91.52%   91.52%           
=======================================
  Files         424      424           
  Lines       20222    20222           
=======================================
  Hits        18509    18509           
  Misses       1329     1329           
  Partials      384      384           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@irisgve
Copy link
Contributor Author

irisgve commented Sep 26, 2024

Hey folks any chance this can get merged? 🙇🏻‍♀️

@dmitryax dmitryax merged commit 431fd11 into open-telemetry:main Sep 27, 2024
49 checks passed
@github-actions github-actions bot added this to the next release milestone Sep 27, 2024
@irisgve irisgve deleted the support-time-envvar-expansion branch September 29, 2024 23:49
jackgopack4 pushed a commit to jackgopack4/opentelemetry-collector that referenced this pull request Oct 8, 2024
…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
HongChenTW pushed a commit to HongChenTW/opentelemetry-collector that referenced this pull request Dec 19, 2024
…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
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.

Issue enforcing quoted values in config
4 participants