Struct kubert::client::ClientArgs
source · pub struct ClientArgs {
pub cluster: Option<String>,
pub context: Option<String>,
pub user: Option<String>,
pub kubeconfig: Option<PathBuf>,
pub impersonate_user: Option<String>,
pub impersonate_group: Option<String>,
}
Available on crate feature
client
only.Expand description
Configures a Kubernetes client
Fields§
§cluster: Option<String>
The name of the kubeconfig cluster to use
context: Option<String>
The name of the kubeconfig context to use
user: Option<String>
The name of the kubeconfig user to use
kubeconfig: Option<PathBuf>
The path to the kubeconfig file to use
impersonate_user: Option<String>
Username to impersonate for Kubernetes operations
impersonate_group: Option<String>
Group to impersonate for Kubernetes operations
Implementations§
source§impl ClientArgs
impl ClientArgs
sourcepub async fn try_client(self) -> Result<Client, ConfigError>
pub async fn try_client(self) -> Result<Client, ConfigError>
Initializes a Kubernetes client
This will respect the $KUBECONFIG
environment variable, but otherwise default to
~/.kube/config
. The current-context is used unless context
is set.
This is basically equivalent to using kube_client::Client::try_default
, except that it
supports kubeconfig configuration from the command-line.
Trait Implementations§
source§impl Clone for ClientArgs
impl Clone for ClientArgs
source§fn clone(&self) -> ClientArgs
fn clone(&self) -> ClientArgs
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ClientArgs
impl Debug for ClientArgs
source§impl Default for ClientArgs
impl Default for ClientArgs
source§fn default() -> ClientArgs
fn default() -> ClientArgs
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientArgs
impl RefUnwindSafe for ClientArgs
impl Send for ClientArgs
impl Sync for ClientArgs
impl Unpin for ClientArgs
impl UnwindSafe for ClientArgs
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more