pub struct EphemeralPool {
pub metadata: ObjectMeta,
pub spec: PoolSpec,
pub status: Option<PoolStatus>,
}Expand description
Auto-generated derived type for PoolSpec via CustomResource
Fields§
§metadata: ObjectMeta§spec: PoolSpec§status: Option<PoolStatus>Implementations§
Source§impl EphemeralPool
impl EphemeralPool
Source§impl EphemeralPool
impl EphemeralPool
Sourcepub fn name_or_empty(&self) -> &str
pub fn name_or_empty(&self) -> &str
Borrow-form metadata-projection primitive on the metadata.name
axis of EphemeralPool: returns the K8s object name slice with
the missing-name corner collapsed to the load-bearing empty-string
sentinel — the ONE-liner collapse of the paired
self.metadata.name.as_deref().unwrap_or("") incantation every
pool-side consumer restated by hand pre-lift.
Pre-lift the .metadata.name.as_deref().unwrap_or("") chain
was hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2
duplication threshold in tatara-pool-reconciler, both keyed
by the pool’s own name slot:
router::pool_name— the tie-break comparator insidebest_match; a deterministic lexicographic-min-name arbiter across two pool candidates whose specificity scores tie.controller_allocation::reconcile_inner— theHashMap< pool-name, Vec<PoolMember>>lookup closure fed intodecide_allocation_reconcile; keys the “which pool members back this allocation candidate?” projection at every allocation-reconcile pass.
Both sites walked the SAME .as_deref().unwrap_or("") chain
and both wanted the &str form the primitive returns — as a
borrow suitable for lexicographic str::cmp in the tie-break
AND for the HashMap<String, _>::get(&str) lookup. Post-lift
each caller reaches for pool.name_or_empty() and the produced
slice feeds the same downstream comparator / lookup unchanged.
The empty-string fallback is the SAME sentinel the sibling
borrow-form primitive crate::crd::Process::uid_or_empty
returns AND the SAME sentinel the owned-form sibling
crate::crd::Process::owned_name_or_empty returns on the
metadata.name axis of the sister CRD — the three primitives
partition the (borrow-form × owned-form) × (uid × name) corner
of the metadata-slot family on identical fallback semantics
(empty string means “the slot is unset”), so a consumer that
switches between the CRD surfaces based on downstream keying
requirements never sees a different missing-slot spelling as
a side effect.
Return-form axis: &str mirrors the borrow-first discipline
of the peer metadata primitives on Process
(crate::crd::Process::namespace_or_default,
crate::crd::Process::name_or_placeholder,
crate::crd::Process::uid_or_empty). The one missing-slot
corner the chain swallowed pre-lift (missing metadata.name)
collapses to the empty-string sentinel so str::is_empty /
HashMap::get on an unnamed pool behaves identically to what
the pre-lift .as_deref().unwrap_or("") chain produced.
A future normalization step (a name-canonicalization pass, a
case-fold key builder, a per-cluster prefix stripper for
cross-cluster pool-name aliasing) lands at ONE substrate
method here and both downstream consumers pick up the upgrade
mechanically — no per-callsite hand-edit at pool_name /
reconcile_inner.
Theory anchor: THEORY.md §VI.1 (generation over composition —
the .metadata.name.as_deref().unwrap_or("") chain recurred
at two hand-authored sites past the ★★ PRIME-DIRECTIVE ≥ 2
duplication trigger, and is lifted to ONE owner here).
THEORY.md §II.1 invariant 5 (composition preserves proofs —
the pins bind the missing-name corner + the empty-string
sentinel byte-shape + the borrow-form &str lifetime + the
byte-identical parity with the pre-lift chain + the fallback-
value coherence with Process::uid_or_empty /
Process::owned_name_or_empty on the metadata-slot × empty-
sentinel axis, so a regression that drifted any surface at
tests::name_or_empty_* here rather than as silent operator-
facing skew between the router tie-break and the allocation
member-lookup on the SAME pool candidate).
Sourcepub fn owned_name_or_empty(&self) -> String
pub fn owned_name_or_empty(&self) -> String
Owned-form metadata-projection primitive on the metadata.name
axis of EphemeralPool: returns an owned String copy of the K8s
object name with the missing-name corner collapsed to the load-
bearing empty-string sentinel — the ONE-liner collapse of the
paired self.metadata.name.clone().unwrap_or_default() incantation
every pool-side consumer restated by hand pre-lift.
Pre-lift the .metadata.name.clone().unwrap_or_default() chain
was hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2
duplication threshold in tatara-pool-reconciler, both keyed by
the pool’s own name slot in an owned String context:
controller_allocation::reconcile_inner— theHashMap<String, Vec<PoolMember>>key seed inside apools.iter().map(|p| ...).collect()fanout; the map key is the ownedStringform because the producedHashMap<String, _>outlives the pool-list borrow that generated it and the downstreampool_members.get(pool.name_or_empty())closure consumes it as&str.allocation_decide::AllocationConvergenceCtx::observe— theAllocationRef::nameslot seed stamped on the matched-pool handle; the struct literal isAllocationRef { name: String, namespace: String }and the produced value is threaded through theDecision::decidetransition rule downstream.
Both sites walked the SAME .clone().unwrap_or_default() chain
and both wanted the String form the primitive returns — as the
owned key of a HashMap<String, _> and as the String slot of
an AllocationRef struct literal. Post-lift each callsite reads
pool.owned_name_or_empty() and the produced value feeds the
same downstream key / struct-literal slot unchanged.
The empty-string fallback is the SAME sentinel the sibling
borrow-form primitive Self::name_or_empty returns AND the
SAME sentinel the sibling owned-form primitive
crate::crd::Process::owned_name_or_empty returns on the
metadata.name axis of the sister CRD — the three primitives
partition the (borrow-form × owned-form) corner of the metadata-
name family across BOTH tatara-process CRDs on identical missing-
slot semantics (empty string means “the slot is unset”), so a
consumer that switches between the CRD surfaces based on
downstream ownership requirements never sees a different
missing-slot spelling as a side effect.
Peer to Self::name_or_empty on the (return-form × ownership)
axis pair — closes the corner the pool-side family previously
left open:
- borrow + empty sentinel →
Self::name_or_empty(router tie- break comparator,HashMap<String, _>::get(&str)lookup — consumers whose downstream keys by&strand allocates nothing); - owned + empty sentinel → this method (HashMap-key seed in
an outliving-borrow context,
AllocationRef::namestruct- literal slot — consumers whose downstream requires the ownedStringform because the produced value outlives the source- pool borrow).
A future normalization step (a name-canonicalization pass, a
case-fold key builder, a per-cluster prefix stripper for cross-
cluster pool-name aliasing) lands at ONE substrate method here
and both downstream consumers pick up the upgrade mechanically —
no per-callsite hand-edit at reconcile_inner /
AllocationConvergenceCtx::observe.
Theory anchor: THEORY.md §VI.1 (generation over composition —
the .metadata.name.clone().unwrap_or_default() chain recurred
at two hand-authored sites past the ★★ PRIME-DIRECTIVE ≥ 2
duplication trigger, and is lifted to ONE owner here).
THEORY.md §II.1 invariant 5 (composition preserves proofs —
the pins bind the missing-name corner + the empty-string
sentinel byte-shape + the owned-form String return type + the
byte-identical parity with the pre-lift chain + the fallback-
value coherence with Self::name_or_empty +
crate::crd::Process::owned_name_or_empty on the metadata-
slot × empty-sentinel axis, so a regression that drifted any
surface at tests::owned_name_or_empty_* here rather than as
silent operator-facing skew between the pool-members lookup key
and the AllocationRef seed on the SAME pool candidate).
Sourcepub fn is_being_deleted(&self) -> bool
pub fn is_being_deleted(&self) -> bool
Copy-form metadata-projection primitive on the deletion-tombstone
axis of EphemeralPool: returns true iff the K8s API server
has stamped a metadata.deletionTimestamp on this pool (the
moment the object entered the “being deleted” corner of its
lifecycle, after which further mutating writes are refused and
finalizers are drained before the object is actually removed) —
the ONE-liner collapse of the paired
self.metadata.deletion_timestamp.is_some() incantation every
pool-side consumer restated by hand pre-lift.
Pre-lift the .metadata.deletion_timestamp.is_some() chain was
hand-authored at TWO sites past the ★★ PRIME-DIRECTIVE ≥ 2
duplication threshold in tatara-pool-reconciler, both
projecting the SAME tombstone-presence predicate on an
EphemeralPool value:
pool_decide::decide_pool_reconcile— the pure decision function’s deletion-preempt gate that forces [PoolDecision::Drain] as soon as the API server stamps the tombstone, before the (desired vs actual) supply-arithmetic branches get a chance to run. Wired at the very top of the decision so a draining pool never spawns / reaps / expires through the normal replenishment arithmetic while the deletion is in flight.controller_pool::pool_phase_from_members— the observed- phase composer’s tombstone-first arm that returnsPoolPhase::Drainingregardless of the supply / demand arithmetic that would otherwise pickReady/Scaling/Degraded. Keeps the reported phase honest during the finalizer drain so operators readingkubectl get ephemeralpoolssee the tombstone-present state asDraining, not as a staleReady.
Both sites walked the SAME .metadata.deletion_timestamp .is_some() chain and both wanted the bool form the primitive
returns — the decide_pool_reconcile site to gate the
→ Drain short-circuit and the pool_phase_from_members site
to gate the → Draining short-circuit. Post-lift each callsite
reads pool.is_being_deleted() and the produced bool feeds
the same downstream short-circuit unchanged.
Sibling to crate::crd::Process::is_being_deleted on the
deletion-tombstone axis of the sister CRD — the two primitives
now partition the tombstone-presence probe across BOTH
tatara-process CRDs on identical missing-slot semantics
(present timestamp means “the API server has begun deletion”),
so an operator or reconciler that switches between the CRD
surfaces never sees a different tombstone-detection spelling
as a side effect.
Return-form axis: bool matches the copy-form discipline of
the sibling crate::crd::Process::is_being_deleted and of
the pool-side crate::phase::ProcessPhase::is_alive +
Self::name_or_empty-family primitives — the underlying
slot is a wire-format Option<Time> that carries only
presence information at this axis (the RFC-3339 timestamp
payload itself is not what the two consumers read; both only
probe presence to detect the tombstone-stamped state).
Returning the raw Option<&Time> would push the .is_some()
probe back to every callsite, restating the pre-lift chain
one link shorter without collapsing the primitive.
Peer to Self::name_or_empty and Self::owned_name_or_empty
on the metadata-projection axis for EphemeralPool; this method
opens the presence-probe corner for the tombstone slot. Future
metadata-presence projections on the pool CRD (an
is_being_finalized projection on
metadata.finalizers.is_empty()’s negation, a has_owner
projection on metadata.owner_references.is_empty()’s
negation) land as peer methods on this same axis.
A future normalization step (a per-tombstone staleness gate
that returns false for a tombstone older than the reconciler’s
grace-period budget, a canonicalization pass that treats a
tombstone from a paused controller as absent, a cross-cluster
tombstone-observation clock skew guard) lands at ONE substrate
method here and both downstream consumers pick up the upgrade
mechanically — no per-callsite hand-edit at
decide_pool_reconcile / pool_phase_from_members.
Theory anchor: THEORY.md §VI.1 (generation over composition —
the .metadata.deletion_timestamp.is_some() chain recurred at
two hand-authored sites past the ★★ PRIME-DIRECTIVE ≥ 2
duplication trigger, and is lifted to ONE owner here).
THEORY.md §II.1 invariant 5 (composition preserves proofs —
the pins bind the missing-tombstone corner + the present-
tombstone corner + the copy-form bool return + the byte-
identical parity with the pre-lift .is_some() chain + the
cross-CRD coherence with crate::crd::Process::is_being_deleted
on the tombstone axis, so a regression that drifted any surface
at tests::is_being_deleted_* rather than as silent operator-
facing skew between the pool-reconciler’s → Drain decision
and the observed-phase composer’s → Draining report on the
SAME EphemeralPool within one reconcile pass).
Trait Implementations§
Source§impl Clone for EphemeralPool
impl Clone for EphemeralPool
Source§fn clone(&self) -> EphemeralPool
fn clone(&self) -> EphemeralPool
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 EphemeralPool
impl CustomResourceExt for EphemeralPool
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 EphemeralPool
impl Debug for EphemeralPool
Source§impl<'de> Deserialize<'de> for EphemeralPool
impl<'de> Deserialize<'de> for EphemeralPool
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 EphemeralPool
impl HasSpec for EphemeralPool
Source§impl HasStatus for EphemeralPool
impl HasStatus for EphemeralPool
Source§type Status = PoolStatus
type Status = PoolStatus
status objectSource§fn status(&self) -> Option<&PoolStatus>
fn status(&self) -> Option<&PoolStatus>
status of the objectSource§fn status_mut(&mut self) -> &mut Option<PoolStatus>
fn status_mut(&mut self) -> &mut Option<PoolStatus>
status of the objectSource§impl JsonSchema for EphemeralPool
impl JsonSchema for EphemeralPool
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 EphemeralPool
impl Resource for EphemeralPool
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 EphemeralPool
impl RefUnwindSafe for EphemeralPool
impl Send for EphemeralPool
impl Sync for EphemeralPool
impl Unpin for EphemeralPool
impl UnsafeUnpin for EphemeralPool
impl UnwindSafe for EphemeralPool
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,
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.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);