Skip to main content

ValidationError

Enum ValidationError 

Source
pub enum ValidationError {
    ClusterRepoNamespaceForbidden {
        namespace: String,
    },
    ConsumerNamespaceNotAllowed {
        namespace: String,
        repo: String,
    },
    DiscoveredMustRetain {
        got: String,
    },
    RestoreSourceRepositoryRequired,
    InlineRetentionForbidden {
        field: String,
    },
    InvalidCron {
        expr: String,
        reason: String,
    },
    MutuallyExclusive {
        a: String,
        b: String,
        context: String,
    },
    MissingRequiredField {
        field: String,
    },
    IdentityTemplateRender {
        reason: String,
    },
    SelectorLabelsUnavailable {
        namespace: String,
        repo: String,
    },
    MaintenanceNamespaceOnNamespacedRepo {
        namespace: String,
    },
}
Expand description

A single cross-field validation failure. PartialEq so tests can assert the exact variant; messages are written for an end user reading a rejected apply.

Variants§

§

ClusterRepoNamespaceForbidden

A Repository/ClusterRepository’s own credential refs, or a consumer’s repository.namespace, set a namespace that the variant forbids. For kind: ClusterRepository, repository.namespace MUST be absent (ADR §3.2/§3.3) — the reference is cluster-scoped by name alone.

Fields

§namespace: String

The forbidden namespace that was set on the reference.

§

ConsumerNamespaceNotAllowed

A consumer namespace is not permitted by the target ClusterRepository’s allowedNamespaces tenancy gate (ADR §3.2/§4.3).

Fields

§namespace: String

The consumer namespace that was denied.

§repo: String

The ClusterRepository whose tenancy gate denied it.

§

DiscoveredMustRetain

A Backup with origin: discovered tried to set a deletionPolicy other than Retain. Discovered snapshots are forced Retain so the operator never deletes data it did not create (ADR §4.5).

Fields

§got: String

The rejected deletionPolicy that was set (anything but Retain).

§

RestoreSourceRepositoryRequired

A Restore with source.identity did not set spec.repository. Identity sources cannot derive a repository, so it is required (ADR §3.6/§4.6).

§

InlineRetentionForbidden

A Repository/ClusterRepository spec carried kopia-side (repo-level) retention policy fields, which conflict with CR-driven GFS retention and risk double-deletion (ADR §4.4 exclusivity).

Fields

§field: String

The offending repo-level retention field that was set.

§

InvalidCron

A cron expression failed to parse with the same parser the controller uses at runtime, so it is rejected at apply time rather than at first reconcile (ADR §4.1).

Fields

§expr: String

The cron expression that failed to parse.

§reason: String

The parser’s reason for rejecting it.

§

MutuallyExclusive

Two fields that may not both be set were both set (e.g. a Source with both pvc and pvcSelector).

Fields

§a: String

The first of the two conflicting fields.

§b: String

The second of the two conflicting fields.

§context: String

Where the conflict occurred (e.g. "backup source"), for the message.

§

MissingRequiredField

A required field (or “at least one of” surface) was empty.

Fields

§field: String

The required field (or “at least one of” surface) that was empty.

§

IdentityTemplateRender

Rendering a ClusterRepository.identityDefaults template with tera failed (ADR §4.2). Surfaced at admission so a bad template never reaches status.

Fields

§reason: String

The underlying tera render error, surfaced for the user.

§

SelectorLabelsUnavailable

A label selector was supplied as the tenancy gate but the caller could not provide the consumer namespace’s labels to match against. We fail closed (deny) rather than guess (ADR §3.2 — the webhook never trusts unfiltered input).

Fields

§namespace: String

The consumer namespace whose labels could not be evaluated.

§repo: String

The ClusterRepository gating by label selector.

§

MaintenanceNamespaceOnNamespacedRepo

A namespaced Repository set spec.maintenance.namespace, which only applies to a cluster-scoped ClusterRepository (a namespaced Repository’s managed Maintenance always lives in the repository’s own namespace). ADR §3.7.

Fields

§namespace: String

The spec.maintenance.namespace value set on the namespaced Repository.

Trait Implementations§

Source§

impl Clone for ValidationError

Source§

fn clone(&self) -> ValidationError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ValidationError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ValidationError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ValidationError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for ValidationError

Source§

fn eq(&self, other: &ValidationError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ValidationError

Source§

impl StructuralPartialEq for ValidationError

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> ServiceExt for T

§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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
§

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,

§

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