-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[release-0.16] 🐛 Refactor tests to drop hard otel dependency #2465
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:release-0.16
from
howardjohn:16/cp-otel-fix
Aug 31, 2023
Merged
[release-0.16] 🐛 Refactor tests to drop hard otel dependency #2465
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:release-0.16
from
howardjohn:16/cp-otel-fix
Aug 31, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since v0.16.0 (kubernetes-sigs#2407), there is an import for all users of various opentelemetry libraries. This is caused by manager test -> pkg/metrics/filters -> k8s.io/apiserver -> otel-go. The issue is API server users a otel-go library from >1 year ago. This makes it impossible to import a modern otel-go library and a modern controller-runtime library together. Go is unable to prune the dependency *even though its only used in tests* (TBH, this surprised me!). By moving the tests that use `filters` under the `filters` package, though, this drops the required dependency on otel-go. Users that import the `filters` package will use it, of course, but everyone does not need to. So basically this refactors tests, but has user facing changes -- fewer dependencies are required to import controller-runtime core, allowing using the newer controller-runtime with newer otel-go. In parallel I will attempt to get k/k to update their otel-go version, but this will take months to ship at the earliest. IMO, this is worth fixing in the meantime as a v0.16.x patch. (cherry picked from commit d17751f)
k8s-ci-robot
added
the
cncf-cla: yes
Indicates the PR's author has signed the CNCF CLA.
label
Aug 31, 2023
k8s-ci-robot
added
the
size/XL
Denotes a PR that changes 500-999 lines, ignoring generated files.
label
Aug 31, 2023
sbueringer
changed the title
🐛 [0.16] Refactor tests to drop hard otel dependency
[release-0.16] 🐛 Refactor tests to drop hard otel dependency
Aug 31, 2023
Thank you!!! /lgtm |
k8s-ci-robot
added
the
lgtm
"Looks good to me", indicates that a PR is ready to be merged.
label
Aug 31, 2023
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: howardjohn, sbueringer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
k8s-ci-robot
added
the
approved
Indicates a PR has been approved by an approver from all required OWNERS files.
label
Aug 31, 2023
renovate bot
referenced
this pull request
in open-feature/flagd
Sep 1, 2023
) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [sigs.k8s.io/controller-runtime](https://togithub.com/kubernetes-sigs/controller-runtime) | require | patch | `v0.16.0` -> `v0.16.1` | --- ### Release Notes <details> <summary>kubernetes-sigs/controller-runtime (sigs.k8s.io/controller-runtime)</summary> ### [`v0.16.1`](https://togithub.com/kubernetes-sigs/controller-runtime/releases/tag/v0.16.1) [Compare Source](https://togithub.com/kubernetes-sigs/controller-runtime/compare/v0.16.0...v0.16.1) #### What's Changed - 🐛 Refactor tests to drop hard otel dependency by [@​howardjohn](https://togithub.com/howardjohn) in [https://github.com/kubernetes-sigs/controller-runtime/pull/2465](https://togithub.com/kubernetes-sigs/controller-runtime/pull/2465) - 🌱 Bump k8s.io/apiserver from 0.28.0 to 0.28.1 by [@​k8s-infra-cherrypick-robot](https://togithub.com/k8s-infra-cherrypick-robot) in [https://github.com/kubernetes-sigs/controller-runtime/pull/2459](https://togithub.com/kubernetes-sigs/controller-runtime/pull/2459) **Full Changelog**: kubernetes-sigs/controller-runtime@v0.16.0...v0.16.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-feature/flagd). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi42OC4xIiwidXBkYXRlZEluVmVyIjoiMzYuNjguMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
approved
Indicates a PR has been approved by an approver from all required OWNERS files.
cncf-cla: yes
Indicates the PR's author has signed the CNCF CLA.
lgtm
"Looks good to me", indicates that a PR is ready to be merged.
size/XL
Denotes a PR that changes 500-999 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since v0.16.0 (#2407), there is an import for all users of various opentelemetry libraries. This is caused by manager test -> pkg/metrics/filters -> k8s.io/apiserver -> otel-go.
The issue is API server users a otel-go library from >1 year ago. This makes it impossible to import a modern otel-go library and a modern controller-runtime library together.
Go is unable to prune the dependency even though its only used in tests (TBH, this surprised me!). By moving the tests that use
filters
under thefilters
package, though, this drops the required dependency on otel-go. Users that import thefilters
package will use it, of course, but everyone does not need to.So basically this refactors tests, but has user facing changes -- fewer dependencies are required to import controller-runtime core, allowing using the newer controller-runtime with newer otel-go.
In parallel I will attempt to get k/k to update their otel-go version, but this will take months to ship at the earliest. IMO, this is worth fixing in the meantime as a v0.16.x patch.
(cherry picked from commit d17751f)
(Manual cherry-pick from: #2460)