#[non_exhaustive]pub struct Condition {
pub type: String,
pub state: State,
pub message: String,
pub last_transition_time: Option<Timestamp>,
pub severity: Severity,
pub reasons: Option<Reasons>,
/* private fields */
}Expand description
Defines a status condition for a resource.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.type: Stringtype is used to communicate the status of the reconciliation process. See also: https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting Types common to all resources include:
- “Ready”: True when the Resource is ready.
state: StateState of the condition.
message: StringHuman readable message indicating details about the current status.
last_transition_time: Option<Timestamp>Last time the condition transitioned from one status to another.
severity: SeverityHow to interpret failures of this condition, one of Error, Warning, Info
reasons: Option<Reasons>The reason for this condition. Depending on the condition type, it will populate one of these fields. Successful conditions cannot have a reason.
Implementations§
Source§impl Condition
impl Condition
pub fn new() -> Self
Sourcepub fn set_message<T: Into<String>>(self, v: T) -> Self
pub fn set_message<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_last_transition_time<T>(self, v: T) -> Self
pub fn set_last_transition_time<T>(self, v: T) -> Self
Sets the value of last_transition_time.
§Example
use wkt::Timestamp;
let x = Condition::new().set_last_transition_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_last_transition_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_last_transition_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of last_transition_time.
§Example
use wkt::Timestamp;
let x = Condition::new().set_or_clear_last_transition_time(Some(Timestamp::default()/* use setters */));
let x = Condition::new().set_or_clear_last_transition_time(None::<Timestamp>);Sourcepub fn set_severity<T: Into<Severity>>(self, v: T) -> Self
pub fn set_severity<T: Into<Severity>>(self, v: T) -> Self
Sourcepub fn set_reasons<T: Into<Option<Reasons>>>(self, v: T) -> Self
pub fn set_reasons<T: Into<Option<Reasons>>>(self, v: T) -> Self
Sets the value of reasons.
Note that all the setters affecting reasons are mutually
exclusive.
§Example
use google_cloud_run_v2::model::condition::CommonReason;
let x0 = Condition::new().set_reasons(Some(
google_cloud_run_v2::model::condition::Reasons::Reason(CommonReason::Unknown)));
let x1 = Condition::new().set_reasons(Some(
google_cloud_run_v2::model::condition::Reasons::Reason(CommonReason::RevisionFailed)));
let x2 = Condition::new().set_reasons(Some(
google_cloud_run_v2::model::condition::Reasons::Reason(CommonReason::ProgressDeadlineExceeded)));Sourcepub fn reason(&self) -> Option<&CommonReason>
pub fn reason(&self) -> Option<&CommonReason>
The value of reasons
if it holds a Reason, None if the field is not set or
holds a different branch.
Sourcepub fn set_reason<T: Into<CommonReason>>(self, v: T) -> Self
pub fn set_reason<T: Into<CommonReason>>(self, v: T) -> Self
Sets the value of reasons
to hold a Reason.
Note that all the setters affecting reasons are
mutually exclusive.
§Example
use google_cloud_run_v2::model::condition::CommonReason;
let x0 = Condition::new().set_reason(CommonReason::Unknown);
let x1 = Condition::new().set_reason(CommonReason::RevisionFailed);
let x2 = Condition::new().set_reason(CommonReason::ProgressDeadlineExceeded);
assert!(x0.reason().is_some());
assert!(x0.revision_reason().is_none());
assert!(x0.execution_reason().is_none());
assert!(x1.reason().is_some());
assert!(x1.revision_reason().is_none());
assert!(x1.execution_reason().is_none());
assert!(x2.reason().is_some());
assert!(x2.revision_reason().is_none());
assert!(x2.execution_reason().is_none());Sourcepub fn revision_reason(&self) -> Option<&RevisionReason>
pub fn revision_reason(&self) -> Option<&RevisionReason>
The value of reasons
if it holds a RevisionReason, None if the field is not set or
holds a different branch.
Sourcepub fn set_revision_reason<T: Into<RevisionReason>>(self, v: T) -> Self
pub fn set_revision_reason<T: Into<RevisionReason>>(self, v: T) -> Self
Sets the value of reasons
to hold a RevisionReason.
Note that all the setters affecting reasons are
mutually exclusive.
§Example
use google_cloud_run_v2::model::condition::RevisionReason;
let x0 = Condition::new().set_revision_reason(RevisionReason::Pending);
let x1 = Condition::new().set_revision_reason(RevisionReason::Reserve);
let x2 = Condition::new().set_revision_reason(RevisionReason::Retired);
assert!(x0.revision_reason().is_some());
assert!(x0.reason().is_none());
assert!(x0.execution_reason().is_none());
assert!(x1.revision_reason().is_some());
assert!(x1.reason().is_none());
assert!(x1.execution_reason().is_none());
assert!(x2.revision_reason().is_some());
assert!(x2.reason().is_none());
assert!(x2.execution_reason().is_none());Sourcepub fn execution_reason(&self) -> Option<&ExecutionReason>
pub fn execution_reason(&self) -> Option<&ExecutionReason>
The value of reasons
if it holds a ExecutionReason, None if the field is not set or
holds a different branch.
Sourcepub fn set_execution_reason<T: Into<ExecutionReason>>(self, v: T) -> Self
pub fn set_execution_reason<T: Into<ExecutionReason>>(self, v: T) -> Self
Sets the value of reasons
to hold a ExecutionReason.
Note that all the setters affecting reasons are
mutually exclusive.
§Example
use google_cloud_run_v2::model::condition::ExecutionReason;
let x0 = Condition::new().set_execution_reason(ExecutionReason::JobStatusServicePollingError);
let x1 = Condition::new().set_execution_reason(ExecutionReason::NonZeroExitCode);
let x2 = Condition::new().set_execution_reason(ExecutionReason::Cancelled);
assert!(x0.execution_reason().is_some());
assert!(x0.reason().is_none());
assert!(x0.revision_reason().is_none());
assert!(x1.execution_reason().is_some());
assert!(x1.reason().is_none());
assert!(x1.revision_reason().is_none());
assert!(x2.execution_reason().is_some());
assert!(x2.reason().is_none());
assert!(x2.revision_reason().is_none());