pub enum Reason {
Show 24 variants
Pulled,
Created,
Started,
Failed,
Killing,
Unhealthy,
ProbeBlind,
BackOff,
Scheduled,
FailedScheduling,
ScalingReplicaSet,
SuccessfulCreate,
SuccessfulDelete,
FailedCreate,
FailedUpdate,
ReplicaSetCreateError,
FailedToUpdateEndpoint,
ProvisioningSucceeded,
ProvisioningFailed,
VolumeFailedDelete,
NetworkPolicyNotEnforced,
ResourcesNotEnforced,
ConfinementNotEnforced,
WouldReject,
}Expand description
The upstream reason vocabulary, closed.
Only reasons engenho can actually emit are listed. A reason with no
emitting site would be a promise the cluster does not keep — the same
“advertised with zero behaviour” pattern this codebase otherwise avoids.
The two exceptions, Reason::ProbeBlind and Reason::WouldReject,
say on their variant which emitter they are waiting for.
Four reasons are engenho’s own, each for a state upstream does not
have: Reason::NetworkPolicyNotEnforced,
Reason::ResourcesNotEnforced, Reason::ProbeBlind and
Reason::WouldReject. Each is Warning. The last two share their
word with what an operator searches for beside them — the kubelet’s
ProbeBlind pod condition, the engenho_would_reject_total metric — so
each pair is found together.
Variants§
Pulled
The image was pulled successfully.
Created
A container was created from the image.
Started
A container was started.
Failed
A container terminated unexpectedly, or could not be started.
Killing
A container was killed (delete, probe failure, restart).
Unhealthy
A liveness/readiness/startup probe failed.
ProbeBlind
A probe could not observe the container at all: the pod has no address to dial, the runtime could not run the exec, or the prober could not form the request. Nothing was asked, so nothing failed — and a blind probe never restarts a container.
Not upstream’s: upstream’s prober reports an errored probe as
Unhealthy, which makes “the prober cannot see” read as “the
workload is failing” to every rule that matches Unhealthy. Named
after the kubelet’s ProbeBlind pod condition, raised once the
blindness is sustained.
Emitter: the kubelet’s blind report, once per blind streak, on the
pod — which at this commit still records Unhealthy (T1.1).
BackOff
The container is in a crash-restart backoff.
Scheduled
The pod was assigned to a node.
FailedScheduling
No node satisfied the pod’s requirements.
ScalingReplicaSet
A ReplicaSet was scaled up or down.
SuccessfulCreate
A ReplicaSet created a pod.
SuccessfulDelete
A ReplicaSet deleted a pod.
FailedCreate
A workload controller could not create a child from its parent’s
template (ReplicaSet, StatefulSet, DaemonSet and Job pods;
CronJob jobs). Upstream’s FailedCreatePodReason. Emitted by the
owned-children sweep and the CronJob sweep, on the parent.
FailedUpdate
A controller could not update an object it maintains. Upstream’s
StatefulSet Failed<Verb> string for update. Emitted by the
NetworkPolicy controller when a policy’s enforcement annotation
cannot be written, and by the pvc-protection controller’s sweep on a
claim whose finalizers it cannot write.
ReplicaSetCreateError
The Deployment controller could not create a ReplicaSet. Upstream’s
deploymentutil.FailedRSCreateReason.
FailedToUpdateEndpoint
The Endpoints controller could not write a Service’s Endpoints or
EndpointSlice. Upstream’s FailedToUpdateEndpoint.
ProvisioningSucceeded
A PersistentVolumeClaim was bound.
ProvisioningFailed
A PersistentVolumeClaim could not be provisioned, for a reason that
retrying will not clear (its declaration is unusable). Emitted by the
pv-binder’s sweep on the claim itself.
VolumeFailedDelete
A Released PersistentVolume could not be reclaimed under its
policy: engenho knows no deleter for it, its policy is one engenho
does not run, or its directory is not the one the local-path
provisioner derived. Upstream’s VolumeFailedDelete. Emitted by the
pv-binder’s volume sweep on the volume, once, as it goes Failed.
NetworkPolicyNotEnforced
A NetworkPolicy was accepted and its rules computed, but no packet
filter was installed — so the traffic it claims to restrict is
unrestricted. The one case where silence would be a SECURITY claim
rather than a missing feature, which is why it is a Warning and
why it is surfaced where kubectl describe shows it.
ResourcesNotEnforced
ConfinementNotEnforced
WouldReject
A gate in Shadow allowed what Enforce would refuse. The string is
engenho_substrate::WouldReject::EVENT_REASON, owned by the
rollout gate and shared with the engenho_would_reject_total metric,
so it is read from there rather than restated here.
Emitter: none yet. A gate’s ledger hook logs and counts; no gate records an Event until one is handed a sink (T0.11).
Implementations§
Source§impl Reason
impl Reason
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The exact wire string — upstream’s, or for engenho’s own reasons the one their owner defines. Diffed in one place, not per call site.
Sourcepub fn severity(self) -> Severity
pub fn severity(self) -> Severity
The severity upstream pairs with this reason.
Derived rather than passed in: a Warning/Normal argument at each
call site is exactly where drift appears, and upstream’s pairing is
fixed per reason.
Exhaustive, with no wildcard arm: a new reason does not compile until
it is given a severity, so it cannot fall silently into Normal.
Trait Implementations§
impl Copy for Reason
impl Eq for Reason
impl StructuralPartialEq for Reason
Auto Trait Implementations§
impl Forget for Reason
impl Freeze for Reason
impl Move for Reason
impl RefUnwindSafe for Reason
impl Send for Reason
impl Sync for Reason
impl Unpin for Reason
impl UnsafeUnpin for Reason
impl UnwindSafe for Reason
Blanket Implementations§
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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);