async fn is_pending_deployment_on_correct_stream(&self, release: Release) -> Result<bool> {
        let msg = rpm_ostree::QueryPendingDeploymentStream {};
        let query_res = self
            .rpm_ostree_actor
            .send(msg)
            .unwrap_or_else(|e| Err(e.into()))
            .await?;

        let (pending, stream) = query_res.ok_or_else(|| {
            format_err!(
                "expected pending deployment '{}', but found none",
                release.version
            )
        })?;

        if pending.version != release.version {
            bail!(
                "expected pending deployment '{}', but found '{}' instead",
                release.version,
                pending.version
            );
        }
        if pending.checksum != release.checksum {
            bail!(
                "detected checksum mismatch for pending deployment '{}', got unexpected value '{}'",
                release.version,
                release.checksum,
            );
        }

        if self.identity.stream != stream {
            log::error!(
                "pending deployment {} expected to be on stream '{}', but found '{}' instead",
                pending.version,
                self.identity.stream,
                stream
            );
            Ok(false)
        } else {
            log::trace!(
                "validated stream '{}' for pending deployment {}",
                stream,
                pending.version
            );
            Ok(true)
        }
    }
/// Validate that pending deployment is coming from the correct update stream.
///
/// This checks that the update stream for the pending deployment matches the current
/// one from agent identity.
/// The validation logic here is meant to run right after an update has been fetched,
/// thus it first ensures that a pending deployment exists with version and
/// checksum matching the one in input.
Validate that pending deployment is coming from the correct update stream.
This checks that the update stream for the pending deployment matches the current
one from agent identity.
The validation logic here is meant to run right after an update has been fetched,
thus it first ensures that a pending deployment exists with version and
checksum matching the one in input.
Validate that pending deployment is coming from the correct update stream . This checks that the update stream for the pending deployment matches the current one from agent identity . The validation logic here is meant to run right after an update has been fetched thus it first ensures that a pending deployment exists with version and checksum matching the one in input .
async fn is_pending_deployment_on_correct_stream(&self, release: Release) -> Result<bool> {
        let msg = rpm_ostree::QueryPendingDeploymentStream {};
        let query_res = self
            .rpm_ostree_actor
            .send(msg)
            .unwrap_or_else(|e| Err(e.into()))
            .await?;
        let (pending, stream) = query_res.ok_or_else(|| {
            format_err!(
                "expected pending deployment '{}', but found none",
                release.version
            )
        })?;
        if pending.version != release.version {
            bail!(
                "expected pending deployment '{}', but found '{}' instead",
                release.version,
                pending.version
            );
        }
        if pending.checksum != release.checksum {
            bail!(
                "detected checksum mismatch for pending deployment '{}', got unexpected value '{}'",
                release.version,
                release.checksum,
            );
        }
        if self.identity.stream != stream {
            log::error!(
                "pending deployment {} expected to be on stream '{}', but found '{}' instead",
                pending.version,
                self.identity.stream,
                stream
            );
            Ok(false)
        } else {
            log::trace!(
                "validated stream '{}' for pending deployment {}",
                stream,
                pending.version
            );
            Ok(true)
        }
    }
async fn is_pending_deployment_on_correct_stream ( & self , release : Release ) -> Result < bool > { let msg = rpm_ostree :: QueryPendingDeploymentStream { } ; let query_res = self . rpm_ostree_actor . send ( msg ) . unwrap_or_else ( | e | Err ( e . into ( ) ) ) . await ? ; let ( pending , stream ) = query_res . ok_or_else ( | | { format_err ! ( " " release version ) } ) ? ; if pending . version != release . version { bail ! ( " " release version pending version ) ; } if pending . checksum != release . checksum { bail ! ( " " release version release checksum ) ; } if self . identity . stream != stream { log :: error ! ( " " pending version self identity stream stream ) ; Ok ( false ) } else { log :: trace ! ( " " stream pending version ) ; Ok ( true ) } }
Validate that pending deployment is coming from the correct update stream.
Validate that pending deployment is coming from the correct update stream .
&self
release
Release