pub struct Manager { /* private fields */ }Expand description
Implements the kustomize deployer.
Implementations§
Source§impl Manager
impl Manager
Sourcepub fn new(
kustomize_backend: Box<dyn KustomizeBackend + Send + Sync>,
kubectl_backend: Box<dyn KubectlBackend + Send + Sync>,
) -> Self
pub fn new( kustomize_backend: Box<dyn KustomizeBackend + Send + Sync>, kubectl_backend: Box<dyn KubectlBackend + Send + Sync>, ) -> Self
Creates a new kustomize deployer manager using the default pki-backed CA provider.
Sourcepub fn with_ca_provider(
kustomize_backend: Box<dyn KustomizeBackend + Send + Sync>,
kubectl_backend: Box<dyn KubectlBackend + Send + Sync>,
ca_provider: Box<dyn CaProvider>,
) -> Self
pub fn with_ca_provider( kustomize_backend: Box<dyn KustomizeBackend + Send + Sync>, kubectl_backend: Box<dyn KubectlBackend + Send + Sync>, ca_provider: Box<dyn CaProvider>, ) -> Self
Creates a kustomize deployer manager with an explicit CA provider. Tests inject a fake provider to avoid touching the filesystem.
Sourcepub fn new_from_options(
kustomize_backend: Option<Box<dyn KustomizeBackend + Send + Sync>>,
kubectl_backend: Option<Box<dyn KubectlBackend + Send + Sync>>,
) -> Self
pub fn new_from_options( kustomize_backend: Option<Box<dyn KustomizeBackend + Send + Sync>>, kubectl_backend: Option<Box<dyn KubectlBackend + Send + Sync>>, ) -> Self
Creates a new kustomize deployer manager from optional backends,
panicking with the same messages as the Go original when either
is absent. Exists only so the “nil backend” Go test has a direct
port; production code should call Manager::new with concrete
backends instead, since Box<dyn Trait> has no “nil” state of
its own.
Sourcepub fn deployer_type(&self) -> &'static str
pub fn deployer_type(&self) -> &'static str
Returns the deployer type that this manager handles
("kustomize").
Sourcepub fn validate(
&self,
deployer_config: &DeployerConfig,
caproni_config: &CaproniConfig,
) -> Result<(), KustomizeError>
pub fn validate( &self, deployer_config: &DeployerConfig, caproni_config: &CaproniConfig, ) -> Result<(), KustomizeError>
Validates the kustomize deployer configuration and referenced
path. The configured path must exist and be a directory at
validation time; a missing path returns
KustomizeError::PathNotFound.
§Errors
Returns KustomizeError if the config is not a kustomize
deployer, the path is missing or unresolvable, or files: is
invalid.
Sourcepub fn deploy(
&self,
deployer_config: &DeployerConfig,
cfg: &Container,
) -> Result<(), KustomizeError>
pub fn deploy( &self, deployer_config: &DeployerConfig, cfg: &Container, ) -> Result<(), KustomizeError>
Builds the kustomization and applies the rendered manifests.
§Errors
Returns KustomizeError if the config is invalid, loading CA
material fails, the build fails, or applying the manifests
fails.
Sourcepub fn undeploy(
&self,
deployer_config: &DeployerConfig,
caproni_config: &CaproniConfig,
) -> Result<(), KustomizeError>
pub fn undeploy( &self, deployer_config: &DeployerConfig, caproni_config: &CaproniConfig, ) -> Result<(), KustomizeError>
Builds the kustomization and deletes the rendered manifests. Missing objects are ignored, so undeploying twice is a no-op.
§Errors
Returns KustomizeError if the config is invalid, the build
fails, or deleting the manifests fails.
Sourcepub fn status(
&self,
deployer_config: &DeployerConfig,
caproni_config: &CaproniConfig,
) -> Result<Status, KustomizeError>
pub fn status( &self, deployer_config: &DeployerConfig, caproni_config: &CaproniConfig, ) -> Result<Status, KustomizeError>
Reports the deployment state of a kustomize deployer.
kustomize applies an arbitrary, unlabelled set of manifests, so
there is no reliable application-agnostic signal to query for
“is this still deployed”. Rather than guess, status reports
State::Deployed whenever the kustomization builds
successfully (the manifests are available to apply) and
State::NotDeployed when the build fails. Deploy is
idempotent, so a redundant apply is harmless.
§Errors
Returns KustomizeError if the config is invalid or resolving
the build source fails.
Trait Implementations§
Source§impl Manager for Manager
Lets the orchestrator drive a kustomize Manager through the registry.
impl Manager for Manager
Lets the orchestrator drive a kustomize Manager through the registry.
Source§fn deployer_type(&self) -> String
fn deployer_type(&self) -> String
"helm").Source§fn 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>>
Source§fn 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>>
Source§fn 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>>
Source§fn 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>>
Ok(()) if valid, or an error describing validation
failures. Files in uncloned repository directories should not
cause validation to fail.Auto Trait Implementations§
impl !RefUnwindSafe for Manager
impl !UnwindSafe for Manager
impl Freeze for Manager
impl Send for Manager
impl Sync for Manager
impl Unpin for Manager
impl UnsafeUnpin for Manager
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§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>
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>
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