-
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
🐛 Refactor tests to drop hard otel dependency #2460
Conversation
Very interesting. I also didn't expect that and tried to implement the feature in a way that exactly something like this does not happen.
That would be great, would be nice if you can link a k/k issue so we can subscribe.
Absolutely agree. Thx for reporting and fixing this so quickly. Let's get this PR merged, cherry-picked and released asap |
Somehow https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.17.0 magically fixes this. I have no clue how, TBH. This is probably still desired anyways but not as important |
Thx for the info. I'm fine with going ahead with this PR regardless, should still be helpful to avoid problems with other versions. (and potential problems with future versions) |
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.
620ec47
to
d17751f
Compare
/retest |
Thank you! |
[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 |
/cherry-pick release-0.16 |
@sbueringer: #2460 failed to apply on top of branch "release-0.16":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@howardjohn Would be nice if you can open a cherry-pick for release-0.16. I'll merge & release after. |
@sbueringer opened #2465, thanks for the review+help |
You're welcome! |
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.