We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Custom clients added in #534 rely on a private Client::new_with_default_ns use in Client::try_default.
Client::new_with_default_ns
Client::try_default
This creates a bit of a footgun between two modes that should work the same: Client::try_default and Client::new(similar_service_stack).
Client::new(similar_service_stack)
Possibly we split the constructor and instead have a moving setter:
impl Client { fn with_default_namespace<T: Into<String>>)(mut self, ns: T) -> Self { self.default_ns = ns.into(); self } }
that way we can have the the comparatively easier to read:
let config = Config::infer().await?; let https = config.native_tls_https_connector()?; let client = Client::new( tower::ServiceBuilder::new() .layer(config.base_uri_layer()) .option_layer(config.auth_layer()?) .service(hyper::Client::builder().build(https)) ).with_default_namespace(config.default_ns);
This makes the config.default_ns a more public facing var, should probably rename it as well to default_namespace.
config.default_ns
default_namespace
The text was updated successfully, but these errors were encountered:
add moving with_default_ns Client setter - fixes #543
17647e1
add moving with_default_namespace Client setter - fixes #543 (#544)
79e7e10
* add moving with_default_ns Client setter - fixes #543 * rename Config::default_ns to Config::default_namespace * remove Client::new_with_default_ns in favour of setter also document * default_namespace as required arg to avoid errors * Update kube/src/client/mod.rs Co-authored-by: kazk <kazk.dev@gmail.com> Co-authored-by: kazk <kazk.dev@gmail.com>
Successfully merging a pull request may close this issue.
Custom clients added in #534 rely on a private
Client::new_with_default_ns
use inClient::try_default
.This creates a bit of a footgun between two modes that should work the same:
Client::try_default
andClient::new(similar_service_stack)
.Possibly we split the constructor and instead have a moving setter:
that way we can have the the comparatively easier to read:
This makes the
config.default_ns
a more public facing var, should probably rename it as well todefault_namespace
.The text was updated successfully, but these errors were encountered: