Skip to content

Commit

Permalink
crd
Browse files Browse the repository at this point in the history
  • Loading branch information
t4lz committed May 6, 2024
1 parent bee54e8 commit befb24b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mirrord/operator/src/crd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,19 @@ pub struct SqsSessionStatus {
pub details: Option<SqsSessionDetails>,
}

impl SqsSessionStatus {
pub fn is_ready(&self) -> bool {
self.details.is_some()
}
}


/// The [`kube::runtime::wait::Condition`] trait is auto-implemented for this function.
/// To be used in [`kube::runtime::wait::await_condition`].
pub fn is_session_ready(session: Option<&MirrordSqsSession>) -> bool {
session
.and_then(|session| session.status.as_ref())
.map(|status| status.details.is_some())
.map(|status| status.is_ready())
.unwrap_or_default()
}

Expand Down

0 comments on commit befb24b

Please sign in to comment.