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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Refactor tests to drop hard otel dependency #2460

Merged
merged 1 commit into from Aug 31, 2023

Commits on Aug 31, 2023

  1. Refactor tests to drop hard otel dependency

    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.
    howardjohn committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    d17751f View commit details
    Browse the repository at this point in the history