xbp-deploy 10.46.0

Service-centric declarative deploy engine for XBP.
Documentation
use thiserror::Error;

pub type Result<T> = std::result::Result<T, DeployError>;

#[derive(Debug, Error)]
pub enum DeployError {
    #[error("config validation failed: {0}")]
    Validation(String),
    #[error("unknown deploy target `{target}`{suggestions}")]
    UnknownTarget {
        target: String,
        suggestions: String,
    },
    #[error("dependency graph error: {0}")]
    Graph(String),
    #[error("OCI error: {0}")]
    Oci(String),
    #[error("Kubernetes error: {0}")]
    K8s(String),
    #[error("health check failed: {0}")]
    Health(String),
    #[error("verify failed: {0}")]
    Verify(String),
    #[error("io error: {0}")]
    Io(String),
    #[error("deploy cancelled")]
    Cancelled,
    #[error("{0}")]
    Other(String),
}

impl From<xbp_oci::OciError> for DeployError {
    fn from(value: xbp_oci::OciError) -> Self {
        Self::Oci(value.to_string())
    }
}

impl From<xbp_k8s::K8sError> for DeployError {
    fn from(value: xbp_k8s::K8sError) -> Self {
        Self::K8s(value.to_string())
    }
}