Skip to main content

Manager

Struct Manager 

Source
pub struct Manager { /* private fields */ }
Expand description

Implements the kustomize deployer.

Implementations§

Source§

impl Manager

Source

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.

Source

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.

Source

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.

Source

pub fn deployer_type(&self) -> &'static str

Returns the deployer type that this manager handles ("kustomize").

Source

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.

Source

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.

Source

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.

Source

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.

Source§

fn deployer_type(&self) -> String

The deployer type that this manager handles (e.g. "helm").
Source§

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

fn undeploy( &self, deployer_config: &DeployerConfig, caproni_config: &CaproniConfig, ) -> Result<(), Box<dyn Error + Send + Sync>>

Removes this deployment from the cluster.
Source§

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

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.

Auto Trait Implementations§

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

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

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

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
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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