pub struct EphemeralAllocation {
pub metadata: ObjectMeta,
pub spec: AllocationSpec,
pub status: Option<AllocationStatus>,
}Expand description
Auto-generated derived type for AllocationSpec via CustomResource
Fields§
§metadata: ObjectMeta§spec: AllocationSpec§status: Option<AllocationStatus>Implementations§
Source§impl EphemeralAllocation
impl EphemeralAllocation
Sourcepub fn new(name: &str, spec: AllocationSpec) -> Self
pub fn new(name: &str, spec: AllocationSpec) -> Self
Spec based constructor for derived custom resource
Source§impl EphemeralAllocation
impl EphemeralAllocation
Sourcepub fn observed_phase(&self) -> Option<AllocationPhase>
pub fn observed_phase(&self) -> Option<AllocationPhase>
The copy-form status-projection primitive on the phase axis:
returns the AllocationPhase the pool reconciler currently
persists at status.phase, wrapped in an Option so the
missing-status corner collapses to None — the ONE-liner
collapse of the paired self.status.as_ref().map(|s| s.phase)
incantation the pool reconciler’s AllocationConvergenceCtx:: observe restated by hand pre-lift.
Cross-CRD peer to crate::prelude::Process::observed_phase
on the (CRD × phase-slot × observed-status) axis pair — both
primitives walk the identical .status.as_ref().map(|s| s. phase) shape, differing only in the Phase type projected
(AllocationPhase vs crate::phase::ProcessPhase). The
substrate now owns the borrow-form .status.as_ref().map(|s| s.phase) chain axis-uniformly across the two Phase-having
CRDs so a future normalization (a generation-filter that
returns None for a phase stamped with a stale
metadata.generation, a staleness gate that drops a phase
whose observing phase_since predates a reconcile deadline,
a canonicalization pass that maps a phase outside the CRD’s
closed set to None) lands at ONE substrate method per CRD
rather than being restated at every observer.
Sourcepub fn observed_phase_or_pending(&self) -> AllocationPhase
pub fn observed_phase_or_pending(&self) -> AllocationPhase
The copy-form status-projection primitive on the phase axis
with the AllocationPhase::Pending sink applied — the
ONE-liner collapse of the paired self.observed_phase(). unwrap_or(AllocationPhase::Pending) incantation the pool
reconciler’s AllocationConvergenceCtx::observe restated by
hand pre-lift as a 5-line .status.as_ref().map(|s| s.phase). unwrap_or(AllocationPhase::Pending) chain.
Pre-lift the chain sat at [tatara-pool-reconciler:: allocation_decide::AllocationConvergenceCtx::observe]’s
phase seed. Cross-CRD peer to [crate::prelude::Process:: observed_phase_or_pending] on the (CRD × phase-slot × sink)
axis pair — both primitives close the missing-status
corner with each CRD’s respective Default-equivalent
Pending variant, and both compose on top of their peer
Self::observed_phase / [crate::prelude::Process:: observed_phase] borrow-form projections so a future
normalization at the underlying observed_phase primitive
reaches both the raw-Option accessor and the Pending-
sinked composer through the SAME upstream body.
The AllocationPhase::Pending sink is load-bearing as the
“not yet observed” default — the pool reconciler’s typed
AllocationPhase::needs_pool_routing predicate returns
true for Pending, so a freshly-admitted Allocation whose
pool reconciler has not yet stamped a .status slot reads
as Pending and immediately enters the routing ladder,
matching the pre-lift AllocationPhase::Pending fallback
semantics verbatim.
Theory anchor: THEORY.md §VI.1 (generation over composition
— the two-link .status.as_ref().map(|s| s.phase).unwrap_or (AllocationPhase::Pending) chain recurred at both the
crate::prelude::Process site (already lifted onto
crate::prelude::Process::observed_phase_or_pending) AND
the EphemeralAllocation site by hand, i.e. the SHAPE
itself recurs past the ★★ PRIME-DIRECTIVE ≥ 2 duplication
trigger, and is lifted to ONE owner per CRD here). THEORY.md
§II.1 invariant 5 (composition preserves proofs — the pins
bind the missing-status sink to Pending + populated-
status pass-through + every AllocationPhase variant
round-trip + byte-identical parity with the pre-lift
two-link chain + cross-CRD peer coherence with
crate::prelude::Process::observed_phase_or_pending, so
a regression that drifted any surface at
tests::observed_phase_* rather than as silent operator-
facing skew between the allocation observer’s routing seed
and the Process observer’s dispatch seed).
Sourcepub fn observed_bound_pool(&self) -> Option<&AllocationRef>
pub fn observed_bound_pool(&self) -> Option<&AllocationRef>
The borrow-form status-projection primitive on the bound-pool
axis: returns the AllocationRef the pool reconciler
currently persists at status.bound_pool (name + namespace of
the pool that owns the matched member), with the
missing-status corner AND the empty-slot corner BOTH
collapsed to None — the ONE-liner collapse of the paired
self.status.as_ref().and_then(|s| s.bound_pool.<clone|as_ref>())
incantation the pool reconciler’s AllocationConvergenceCtx:: observe restated by hand pre-lift.
Cross-CRD peer to crate::prelude::Process::observed_identity
on the (CRD × structured-record-slot × borrow-form) axis pair
— both primitives walk the identical .status.as_ref() .and_then(|s| s.<slot>.as_ref()) shape, differing only in the
record projected (AllocationRef here, [crate::identity:: Identity] on Process). The substrate now owns the
borrow-form .status.as_ref().and_then(|s| s.<slot>.as_ref())
chain on the second structured-record slot across the two
status-having CRDs, so a future normalization step (a
generation-filter that returns None for a bound-pool
reference stamped with a stale metadata.generation, a
canonicalization pass that rejects a malformed
(name, namespace) pair, a cross-cluster reference-rewrite
gate) lands at ONE substrate method per CRD rather than being
restated at every observer.
Return-form axis: Option<&AllocationRef> mirrors the
borrow-first discipline of [crate::prelude::Process:: observed_identity]. The lone pre-lift consumer
([tatara-pool-reconciler::allocation_decide:: AllocationConvergenceCtx::observe]’s bound_pool seed) spelled
the projection as .and_then(|s| s.bound_pool.clone()) — an
eager clone allocated inside every reconcile pass even when the
downstream branch (the Release-composition arm) needed only the
borrow for the .as_ref() re-projection two lines later.
Post-lift the consumer reaches the primitive borrow-first
(alloc.observed_bound_pool().cloned()) and the empty-borrow
corner clones nothing (Option::cloned on None is None);
the composition point where the owned AllocationRef fallback
is required (the AllocationConvergenceCtx snapshot slot,
still Option<AllocationRef>-typed for serde stability) is the
ONLY site that materializes an owned copy.
The missing-status corner AND the populated-status-with-
bound_pool=None corner BOTH collapse to None so
.is_some() / if let Some(_) / .cloned() behave
identically on an EphemeralAllocation whose status field is
None and on one whose status carries an unpopulated
bound_pool slot — matching what the pre-lift .and_then(...)
chain produced. Consumers that need to tell those corners
apart reach for Self::status directly, exactly as the
existing peer accessors Self::observed_phase +
Self::observed_phase_or_pending admit.
Theory anchor: THEORY.md §VI.1 (generation over composition
— the .status.as_ref().and_then(|s| s.<structured-record> .<clone|as_ref>()) shape recurred as ONE hand-authored
.and_then(|s| s.bound_pool.clone()) chain in
[tatara-pool-reconciler::allocation_decide:: AllocationConvergenceCtx::observe] AND as the peer
crate::prelude::Process::observed_identity primitive
already owned on the Process CRD’s status.identity slot,
past the ★★ PRIME-DIRECTIVE ≥ 2 duplication trigger at
substrate-shape level. THEORY.md §II.1 invariant 5
(composition preserves proofs — the pins bind the missing-
status corner + the empty-bound_pool-slot corner + the
borrow-form &AllocationRef lifetime + the zero-copy
projection contract + byte-identical parity with the pre-lift
.and_then(|s| s.bound_pool.clone()) chain across the full
corner set + cross-CRD peer coherence with
crate::prelude::Process::observed_identity, so a
regression that drifted any surface at
tests::observed_bound_pool_* rather than as silent operator-
facing skew between the allocation observer’s Release-
composition seed and the Process observer’s FORK-time
identity seed on the SAME reconcile tick).
Sourcepub fn observed_expires_at(&self) -> Option<DateTime<Utc>>
pub fn observed_expires_at(&self) -> Option<DateTime<Utc>>
The copy-form status-projection primitive on the TTL-expiry axis:
returns the wall-clock deadline the pool reconciler currently
persists at status.expires_at (derived from spec.ttl +
allocated_at at Bind time), wrapped in an Option so both the
missing-status corner AND the populated-status-with-expires_at =None corner collapse to None — the ONE-liner collapse of the
paired self.status.as_ref().and_then(|s| s.expires_at)
incantation the pool reconciler’s AllocationConvergenceCtx:: observe restated by hand pre-lift.
Same-CRD peer to Self::observed_phase on the (CRD × copy-form
× status-slot) axis pair — both primitives walk the identical
.status.as_ref().<map|and_then>(|s| s.<Copy-field>) shape,
differing only in the record projected (DateTime<Utc> here,
AllocationPhase on the phase axis) and in the outer combinator
(and_then here because the persisted field is itself an
Option<DateTime<Utc>>, map there because the persisted phase
is bare). The substrate now owns the copy-form
.status.as_ref().<map|and_then>(|s| s.<Copy-field>) chain
axis-uniformly across every Copy-valued slot on
AllocationStatus, so a future normalization (a clock-skew
guard that drops an expires_at stamped before its owning
allocation’s observed allocated_at, a canonicalization pass
that clamps a deadline to a monotonic upper bound, a stale-
timestamp gate that returns None on an expires_at older than
a controller-configured horizon) lands at ONE substrate method
rather than being restated at every observer.
Return-form axis: Option<DateTime<Utc>> mirrors the copy-first
discipline of Self::observed_phase. The lone pre-lift consumer
([tatara-pool-reconciler::allocation_decide:: AllocationConvergenceCtx::observe]’s expires_at seed) spelled
the projection as .status.as_ref().and_then(|s| s.expires_at) —
a 3-link hand-authored chain the observer walked on every
reconcile pass. Post-lift the consumer reaches the primitive
once and the whole missing-status + empty-slot corner cross
collapses at the substrate rather than at the callsite.
The missing-status corner AND the populated-status-with-
expires_at=None corner BOTH collapse to None so
.is_some() / if let Some(_) / any >= deadline comparison
behave identically on an EphemeralAllocation whose status
field is None and on one whose status carries an unpopulated
expires_at slot — matching what the pre-lift .and_then(...)
chain produced. Consumers that need to tell those corners apart
reach for Self::status directly, exactly as the existing peer
accessors Self::observed_phase +
Self::observed_phase_or_pending admit.
Theory anchor: THEORY.md §VI.1 (generation over composition —
the .status.as_ref().and_then(|s| s.<Copy-field>) shape
recurred as ONE hand-authored chain in
[tatara-pool-reconciler::allocation_decide:: AllocationConvergenceCtx::observe] AND as the copy-form peer
Self::observed_phase primitive already owned on the same
CRD’s status.phase slot, past the substrate-shape recurrence
trigger; the substrate now owns the third status-projection
primitive on EphemeralAllocation, closing the copy-form family
alongside the borrow-form Self::observed_bound_pool).
THEORY.md §II.1 invariant 5 (composition preserves proofs — the
pins bind the missing-status corner + the empty-expires_at-
slot corner + the copy-form DateTime<Utc> return + byte-
identical parity with the pre-lift .and_then(|s| s.expires_at)
chain across the full corner set, so a regression that drifted
any surface surfaces at tests::observed_expires_at_* rather
than as silent operator-facing skew between the allocation
observer’s Release-composition TTL gate and any future consumer
that reaches for the same slot).
Trait Implementations§
Source§impl Clone for EphemeralAllocation
impl Clone for EphemeralAllocation
Source§fn clone(&self) -> EphemeralAllocation
fn clone(&self) -> EphemeralAllocation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CustomResourceExt for EphemeralAllocation
impl CustomResourceExt for EphemeralAllocation
Source§fn crd() -> CustomResourceDefinition
fn crd() -> CustomResourceDefinition
Source§fn crd_name() -> &'static str
fn crd_name() -> &'static str
CustomResourceDefinition in kubernetes. Read moreSource§fn api_resource() -> ApiResource
fn api_resource() -> ApiResource
ApiSource§fn shortnames() -> &'static [&'static str]
fn shortnames() -> &'static [&'static str]
Source§impl Debug for EphemeralAllocation
impl Debug for EphemeralAllocation
Source§impl<'de> Deserialize<'de> for EphemeralAllocation
impl<'de> Deserialize<'de> for EphemeralAllocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl HasSpec for EphemeralAllocation
impl HasSpec for EphemeralAllocation
Source§type Spec = AllocationSpec
type Spec = AllocationSpec
spec of this resourceSource§fn spec(&self) -> &AllocationSpec
fn spec(&self) -> &AllocationSpec
spec of the objectSource§fn spec_mut(&mut self) -> &mut AllocationSpec
fn spec_mut(&mut self) -> &mut AllocationSpec
spec of the objectSource§impl HasStatus for EphemeralAllocation
impl HasStatus for EphemeralAllocation
Source§type Status = AllocationStatus
type Status = AllocationStatus
status objectSource§fn status(&self) -> Option<&AllocationStatus>
fn status(&self) -> Option<&AllocationStatus>
status of the objectSource§fn status_mut(&mut self) -> &mut Option<AllocationStatus>
fn status_mut(&mut self) -> &mut Option<AllocationStatus>
status of the objectSource§impl JsonSchema for EphemeralAllocation
impl JsonSchema for EphemeralAllocation
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl Resource for EphemeralAllocation
impl Resource for EphemeralAllocation
Source§type DynamicType = ()
type DynamicType = ()
Source§type Scope = NamespaceResourceScope
type Scope = NamespaceResourceScope
Source§fn meta(&self) -> &ObjectMeta
fn meta(&self) -> &ObjectMeta
Source§fn meta_mut(&mut self) -> &mut ObjectMeta
fn meta_mut(&mut self) -> &mut ObjectMeta
Source§fn url_path(dt: &Self::DynamicType, namespace: Option<&str>) -> String
fn url_path(dt: &Self::DynamicType, namespace: Option<&str>) -> String
Source§fn object_ref(&self, dt: &Self::DynamicType) -> ObjectReference
fn object_ref(&self, dt: &Self::DynamicType) -> ObjectReference
Source§fn controller_owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>
fn controller_owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>
Source§fn owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>
fn owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>
Auto Trait Implementations§
impl Freeze for EphemeralAllocation
impl RefUnwindSafe for EphemeralAllocation
impl Send for EphemeralAllocation
impl Sync for EphemeralAllocation
impl Unpin for EphemeralAllocation
impl UnsafeUnpin for EphemeralAllocation
impl UnwindSafe for EphemeralAllocation
Blanket Implementations§
impl<T> AppData for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
impl<T> AppDataResponse for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DeletionTombstoned for T
impl<T> DeletionTombstoned for T
Source§fn is_being_deleted(&self) -> bool
fn is_being_deleted(&self) -> bool
metadata.deletionTimestamp
on this resource — a DELETE is in flight and finalizers are
draining. See the trait-level docs for the axis-family context,
peer inherent methods, and future-normalization anchor.impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<K> Lookup for Kwhere
K: Resource,
impl<K> Lookup for Kwhere
K: Resource,
Source§type DynamicType = <K as Resource>::DynamicType
type DynamicType = <K as Resource>::DynamicType
Resource::DynamicType.Source§fn resource_version(&self) -> Option<Cow<'_, str>>
fn resource_version(&self) -> Option<Cow<'_, str>>
Source§fn api_version(dyntype: &Self::DynamicType) -> Cow<'_, str>
fn api_version(dyntype: &Self::DynamicType) -> Cow<'_, str>
Source§fn to_object_ref(&self, dyntype: Self::DynamicType) -> ObjectRef<Self>
fn to_object_ref(&self, dyntype: Self::DynamicType) -> ObjectRef<Self>
ObjectRef for this object.Source§impl<T> NamespacedApiCoordinates for T
impl<T> NamespacedApiCoordinates for T
Source§fn owned_coordinates_required(&self) -> Result<(String, String)>
fn owned_coordinates_required(&self) -> Result<(String, String)>
Strings,
erroring with a Self::kind-prefixed message when either
slot is absent. See the trait-level docs for the axis-family
context, peer primitives, and future-normalization anchor.impl<T> OptionalSend for T
impl<T> OptionalSync for T
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);