use std::io::Error as IoError;
use thiserror::Error;
use fluvio::FluvioError;
use k8_config::{ConfigError as K8ConfigError};
use k8_client::{ClientError as K8ClientError};
use crate::helm::HelmError;
use crate::check::CheckError;
#[derive(Error, Debug)]
pub enum ClusterError {
#[error(transparent)]
IoError {
#[from]
source: IoError,
},
#[error("Fluvio client error")]
FluvioError {
#[from]
source: FluvioError,
},
#[error("Kubernetes config error")]
K8ConfigError {
#[from]
source: K8ConfigError,
},
#[error("Kubernetes client error")]
K8ClientError {
#[from]
source: K8ClientError,
},
#[error("Helm client error")]
HelmError {
#[from]
source: HelmError,
},
#[error("Fluvio pre-installation check failed")]
PreCheckError {
#[from]
source: CheckError,
},
#[error("Timed out when waiting for SC service")]
SCServiceTimeout,
#[error("Timed out when waiting for SC port check")]
SCPortCheckTimeout,
#[error("Timed out when waiting for DNS resolution")]
SCDNSTimeout,
#[error("Timed out when waiting for SPU")]
SPUTimeout,
#[error("An unknown error occurred: {0}")]
Other(String),
}