pub trait Manager {
// Required methods
fn deployer_type(&self) -> String;
fn deploy(
&self,
deployer_config: &DeployerConfig,
cfg: Option<&Container>,
) -> Result<(), Box<dyn Error + Send + Sync>>;
fn undeploy(
&self,
deployer_config: &DeployerConfig,
caproni_config: &CaproniConfig,
) -> Result<(), Box<dyn Error + Send + Sync>>;
fn status(
&self,
deployer_config: &DeployerConfig,
caproni_config: &CaproniConfig,
) -> Result<Status, Box<dyn Error + Send + Sync>>;
fn validate(
&self,
deployer_config: &DeployerConfig,
caproni_config: &CaproniConfig,
) -> Result<(), Box<dyn Error + Send + Sync>>;
}Expand description
The interface for managing deployment lifecycle. Implementations are responsible for deploying and managing applications using specific deployment strategies (e.g. Helm charts).
Required Methods§
Sourcefn deployer_type(&self) -> String
fn deployer_type(&self) -> String
The deployer type that this manager handles (e.g. "helm").
Sourcefn deploy(
&self,
deployer_config: &DeployerConfig,
cfg: Option<&Container>,
) -> Result<(), Box<dyn Error + Send + Sync>>
fn deploy( &self, deployer_config: &DeployerConfig, cfg: Option<&Container>, ) -> Result<(), Box<dyn Error + Send + Sync>>
Deploys the application to the cluster. If the application is already deployed, this updates it to match the current configuration.
Sourcefn undeploy(
&self,
deployer_config: &DeployerConfig,
caproni_config: &CaproniConfig,
) -> Result<(), Box<dyn Error + Send + Sync>>
fn undeploy( &self, deployer_config: &DeployerConfig, caproni_config: &CaproniConfig, ) -> Result<(), Box<dyn Error + Send + Sync>>
Removes this deployment from the cluster.
Sourcefn status(
&self,
deployer_config: &DeployerConfig,
caproni_config: &CaproniConfig,
) -> Result<Status, Box<dyn Error + Send + Sync>>
fn status( &self, deployer_config: &DeployerConfig, caproni_config: &CaproniConfig, ) -> Result<Status, Box<dyn Error + Send + Sync>>
Returns the current status of the deployment. Returns an error if unable to determine deployment state.
Sourcefn validate(
&self,
deployer_config: &DeployerConfig,
caproni_config: &CaproniConfig,
) -> Result<(), Box<dyn Error + Send + Sync>>
fn validate( &self, deployer_config: &DeployerConfig, caproni_config: &CaproniConfig, ) -> Result<(), Box<dyn Error + Send + Sync>>
Validates the deployer configuration and referenced files.
Returns Ok(()) if valid, or an error describing validation
failures. Files in uncloned repository directories should not
cause validation to fail.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Manager for xianyun_deploy::deployer::kustomize::manager::Manager
Lets the orchestrator drive a kustomize Manager through the registry.
impl Manager for xianyun_deploy::deployer::namespace::manager::Manager
Lets the orchestrator drive a namespace Manager through the registry.
impl<B: HelmBackend> Manager for xianyun_deploy::deployer::helm::manager::Manager<B>
Lets the orchestrator drive a helm Manager through the registry.