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

deps: remove hyper-rustls/ring feature #1717

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eliad-wiz
Copy link
Contributor

Motivation

no reason to include the "ring" crate if aws-lc-rs is being used.

Solution

features are only additive, so they can't be removed once it's added (by any sub-crate).
avoid adding extra features that might not be used (e.g. in case of aws-lc-rs).

in order to make it optional we can add a new "ring" feature to the default features, so it can be avoided with default-features = false. however, i think letting the configure it as needed is a better approach.

please update if you do prefer to add a new default feature-flag (or some other approach) and i'll adjust the patch.

@eliad-wiz eliad-wiz force-pushed the remove-ring-dependency branch 3 times, most recently from 066cc7a to 6f04610 Compare March 9, 2025 16:47
@clux clux added the changelog-change changelog change category for prs label Mar 11, 2025
@eliad-wiz eliad-wiz force-pushed the remove-ring-dependency branch from 6f04610 to 467eb1a Compare March 11, 2025 11:44
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 76.1%. Comparing base (b21a4e5) to head (375899d).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
kube-client/src/client/auth/oauth.rs 0.0% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1717     +/-   ##
=======================================
- Coverage   76.1%   76.1%   -0.0%     
=======================================
  Files         84      84             
  Lines       7860    7862      +2     
=======================================
  Hits        5977    5977             
- Misses      1883    1885      +2     
Files with missing lines Coverage Δ
kube-client/src/client/auth/oauth.rs 0.0% <0.0%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

#[cfg(not(any(
all(
feature = "rustls-tls",
any(feature = "ring", feature = "aws-lc-rs", feature = "webpki-roots")
Copy link
Member

@clux clux Mar 11, 2025

Choose a reason for hiding this comment

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

i think we need (when using rustls);

  • one of aws-lc-rs or ring
  • webpki-roots optional, but orthogonal to this choice (so probably does not need to be checked here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see my previous comment.
let's try adding cfg-if to make it a bit clearer

Copy link
Member

@clux clux Mar 11, 2025

Choose a reason for hiding this comment

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

i think we can avoid this extra change and dependency, and keep all logic as we had it before by introducing the new compile error up to top level (257 in oidc.rs).

#[cfg(all(feature = "rustls-tls", not(any(feature = "ring", feature = "aws-lc-rs"))))]
compile_error!("At least one of ring or aws-lc-rs feature must be enabled to use rustls-tls feature");

Copy link
Member

@clux clux Mar 11, 2025

Choose a reason for hiding this comment

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

mostly because the way it's indented now is also quite big and hard to extend, and we want to just bail out as soon as possible anyway.

besides, oidc.rs isn't even the client that is used for most things (that one comes from config_ext.rs + builder.rs and does the selection in tls.rs (which does not do this same if-else on providers).

@eliad-wiz eliad-wiz force-pushed the remove-ring-dependency branch from 467eb1a to e0f4a9a Compare March 11, 2025 13:57
no reason to include the "ring" crate if aws-lc-rs is being used.

add a new "ring" feature (enabled by default, to avoid breaking
existing users), that will enable hyper-rustls/ring only if needed.

Signed-off-by: Eliad Peller <[email protected]>
@eliad-wiz eliad-wiz force-pushed the remove-ring-dependency branch from e0f4a9a to 375899d Compare March 11, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-change changelog change category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants