pub struct Client { /* private fields */ }Expand description
Ported from Client in client.go.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(executor: Arc<dyn CommandRunner + Send + Sync>) -> Self
pub fn new(executor: Arc<dyn CommandRunner + Send + Sync>) -> Self
Ported from NewClient. Go’s zero-argument NewClient reads the
command runner from the ambient context.Context on every call
instead of taking it at construction; this port takes it
explicitly, matching docker::Client/git::Client. See
PORT_NOTES.md.
Sourcepub fn with_config(
executor: Arc<dyn CommandRunner + Send + Sync>,
kubeconfig: &str,
) -> Self
pub fn with_config( executor: Arc<dyn CommandRunner + Send + Sync>, kubeconfig: &str, ) -> Self
Ported from NewClientWithConfig.
Trait Implementations§
Source§impl Backend for Client
impl Backend for Client
fn get( &self, resource_type: &str, name: &str, namespace: &str, ) -> Result<String, KubectlError>
fn delete_pods_by_label( &self, namespace: &str, label_selector: &str, ) -> Result<usize, KubectlError>
fn get_version( &self, timeout: Duration, interval: Duration, ) -> Result<VersionResponse, KubectlError>
fn scale( &self, resource_type: &str, name: &str, namespace: &str, replicas: i64, ) -> Result<(), KubectlError>
fn apply(&self, json_data: &[u8], namespace: &str) -> Result<(), KubectlError>
fn delete_manifest( &self, data: &[u8], namespace: &str, ) -> Result<(), KubectlError>
fn delete( &self, resource_type: &str, name: &str, namespace: &str, ) -> Result<(), KubectlError>
fn wait( &self, resource_type: &str, name: &str, namespace: &str, condition: &str, timeout: Duration, ) -> Result<(), KubectlError>
fn wait_for_rollout_status( &self, resource_type: &str, name: &str, namespace: &str, timeout: Duration, ) -> Result<(), KubectlError>
fn wait_for_pod_ready_by_label( &self, namespace: &str, label_selector: &str, timeout: Duration, ) -> Result<(), KubectlError>
fn wait_for_job_complete( &self, name: &str, namespace: &str, timeout: Duration, ) -> Result<(), KubectlError>
fn wait_for_job_created( &self, name: &str, namespace: &str, timeout: Duration, ) -> Result<(), KubectlError>
fn list_resource_names( &self, kind: &str, namespace: &str, label_selector: &str, ) -> Result<Vec<String>, KubectlError>
fn ensure_namespace(&self, name: &str) -> Result<(), KubectlError>
fn delete_namespace(&self, name: &str) -> Result<(), KubectlError>
fn namespace_exists(&self, name: &str) -> Result<bool, KubectlError>
fn wait_for_namespace_ready( &self, name: &str, timeout: Duration, ) -> Result<(), KubectlError>
fn run_job( &self, image: &str, namespace: &str, timeout: Duration, command: &[&str], ) -> Result<String, KubectlError>
fn get_raw(&self, path: &str) -> Result<String, KubectlError>
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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