Error

Enum Error 

Source
pub enum Error {
Show 27 variants ConnectionError(String), ConfigurationError(String), DeploymentError(String), RollbackError(String), ScalingError(String), ServiceError(String), SecretError(String), NamespaceError(String), ConfigMapError(String), IngressError(String), GatewayError(String), ValidationError(String), NetworkPolicyError(String), JobError(String), CronJobError(String), PvcError(String), HpaError(String), ResourceNotFound { kind: String, name: String, namespace: String, }, ResourceAlreadyExists { kind: String, name: String, namespace: String, }, Timeout { resource: String, timeout_secs: u64, details: String, }, PodFailed { pod_name: String, reason: String, }, ContainerCrashed { pod: String, container: String, exit_code: i32, restarts: i32, }, ImagePullError { image: String, reason: String, }, InvalidSpec(String), SerializationError(String), KubeError(Error), Internal(String),
}
Expand description

Main error type for all Kubernetes operations.

Variants§

§

ConnectionError(String)

Error connecting to the Kubernetes cluster.

§

ConfigurationError(String)

Error with Kubernetes configuration (kubeconfig, credentials, etc.).

§

DeploymentError(String)

Error during deployment operations.

§

RollbackError(String)

Error during rollback operations.

§

ScalingError(String)

Error during scaling operations.

§

ServiceError(String)

Error during service operations.

§

SecretError(String)

Error during secret operations.

§

NamespaceError(String)

Error during namespace operations.

§

ConfigMapError(String)

Error during ConfigMap operations.

§

IngressError(String)

Error during Ingress operations.

§

GatewayError(String)

Error during Gateway operations.

§

ValidationError(String)

Validation error for resource specs.

§

NetworkPolicyError(String)

Error during NetworkPolicy operations.

§

JobError(String)

Error during Job operations.

§

CronJobError(String)

Error during CronJob operations.

§

PvcError(String)

Error during PersistentVolumeClaim operations.

§

HpaError(String)

Error during HorizontalPodAutoscaler operations.

§

ResourceNotFound

Resource not found in the cluster.

Fields

§kind: String

Kind of resource.

§name: String

Name of resource.

§namespace: String

Namespace where resource was searched.

§

ResourceAlreadyExists

Resource already exists.

Fields

§kind: String

Kind of resource.

§name: String

Name of resource.

§namespace: String

Namespace where resource exists.

§

Timeout

Timeout waiting for a resource to be ready.

Fields

§resource: String

Resource name.

§timeout_secs: u64

Timeout duration in seconds.

§details: String

Additional details.

§

PodFailed

Pod failed with an error.

Fields

§pod_name: String

Pod name.

§reason: String

Failure reason.

§

ContainerCrashed

Container crashed.

Fields

§pod: String

Pod name.

§container: String

Container name.

§exit_code: i32

Exit code.

§restarts: i32

Restart count.

§

ImagePullError

Image pull error.

Fields

§image: String

Image name.

§reason: String

Error reason.

§

InvalidSpec(String)

Invalid resource specification.

§

SerializationError(String)

Serialization/deserialization error.

§

KubeError(Error)

Underlying Kubernetes API error.

§

Internal(String)

Generic internal error.

Implementations§

Source§

impl Error

Source

pub fn connection<S: Into<String>>(msg: S) -> Self

Create a connection error.

Source

pub fn config<S: Into<String>>(msg: S) -> Self

Create a configuration error.

Source

pub fn deployment<S: Into<String>>(msg: S) -> Self

Create a deployment error.

Source

pub fn rollback<S: Into<String>>(msg: S) -> Self

Create a rollback error.

Source

pub fn scaling<S: Into<String>>(msg: S) -> Self

Create a scaling error.

Source

pub fn service<S: Into<String>>(msg: S) -> Self

Create a service error.

Source

pub fn secret<S: Into<String>>(msg: S) -> Self

Create a secret error.

Source

pub fn namespace<S: Into<String>>(msg: S) -> Self

Create a namespace error.

Source

pub fn configmap<S: Into<String>>(msg: S) -> Self

Create a ConfigMap error.

Source

pub fn ingress<S: Into<String>>(msg: S) -> Self

Create an Ingress error.

Source

pub fn gateway<S: Into<String>>(msg: S) -> Self

Create a Gateway error.

Source

pub fn validation<S: Into<String>>(msg: S) -> Self

Create a validation error.

Source

pub fn network_policy<S: Into<String>>(msg: S) -> Self

Create a NetworkPolicy error.

Source

pub fn job<S: Into<String>>(msg: S) -> Self

Create a Job error.

Source

pub fn cronjob<S: Into<String>>(msg: S) -> Self

Create a CronJob error.

Source

pub fn pvc<S: Into<String>>(msg: S) -> Self

Create a PVC error.

Source

pub fn hpa<S: Into<String>>(msg: S) -> Self

Create an HPA error.

Source

pub fn not_found<S: Into<String>>(kind: S, name: S, namespace: S) -> Self

Create a resource not found error.

Source

pub fn already_exists<S: Into<String>>(kind: S, name: S, namespace: S) -> Self

Create a resource already exists error.

Source

pub fn timeout<S: Into<String>>( resource: S, timeout_secs: u64, details: S, ) -> Self

Create a timeout error.

Source

pub fn pod_failed<S: Into<String>>(pod_name: S, reason: S) -> Self

Create a pod failed error.

Source

pub fn container_crashed<S: Into<String>>( pod: S, container: S, exit_code: i32, restarts: i32, ) -> Self

Create a container crashed error.

Source

pub fn image_pull<S1: Into<String>, S2: Into<String>>( image: S1, reason: S2, ) -> Self

Create an image pull error.

Source

pub fn invalid_spec<S: Into<String>>(msg: S) -> Self

Create an invalid spec error.

Source

pub fn internal<S: Into<String>>(msg: S) -> Self

Create an internal error.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more