Use upstream commit for actix 0.10.0 support.
Instead of the sed statement we'll use the official upstream commit for this.
This commit is contained in:
parent
46ce5d1a71
commit
b1db82382b
|
@ -0,0 +1,121 @@
|
|||
From 231d7cba7fb42924f85f21743923bd404eef9d1a Mon Sep 17 00:00:00 2001
|
||||
From: Luca BRUNO <luca.bruno@coreos.com>
|
||||
Date: Tue, 29 Sep 2020 07:24:03 +0000
|
||||
Subject: [PATCH] update_agent: adapt to actix-0.10 API changes
|
||||
|
||||
---
|
||||
src/update_agent/actor.rs | 24 ++++++++++++------------
|
||||
1 file changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/update_agent/actor.rs b/src/update_agent/actor.rs
|
||||
index ed51db2..65a2891 100644
|
||||
--- a/src/update_agent/actor.rs
|
||||
+++ b/src/update_agent/actor.rs
|
||||
@@ -99,7 +99,7 @@ impl Handler<RefreshTick> for UpdateAgent {
|
||||
// Process state machine refresh ticks sequentially.
|
||||
ctx.wait(update_machine);
|
||||
|
||||
- Box::new(actix::fut::ok(()))
|
||||
+ Box::pin(actix::fut::ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ impl UpdateAgent {
|
||||
Ok(())
|
||||
});
|
||||
|
||||
- Box::new(initialization)
|
||||
+ Box::pin(initialization)
|
||||
}
|
||||
|
||||
/// Try to report steady state.
|
||||
@@ -181,7 +181,7 @@ impl UpdateAgent {
|
||||
Ok(())
|
||||
});
|
||||
|
||||
- Box::new(state_change)
|
||||
+ Box::pin(state_change)
|
||||
}
|
||||
|
||||
/// Try to check for updates.
|
||||
@@ -210,7 +210,7 @@ impl UpdateAgent {
|
||||
Ok(())
|
||||
});
|
||||
|
||||
- Box::new(state_change)
|
||||
+ Box::pin(state_change)
|
||||
}
|
||||
|
||||
/// Try to stage an update.
|
||||
@@ -227,7 +227,7 @@ impl UpdateAgent {
|
||||
Ok(())
|
||||
});
|
||||
|
||||
- Box::new(state_change)
|
||||
+ Box::pin(state_change)
|
||||
}
|
||||
|
||||
/// Try to finalize an update.
|
||||
@@ -242,7 +242,7 @@ impl UpdateAgent {
|
||||
.then(|can_finalize, actor, _ctx| actor.finalize_deployment(can_finalize, release))
|
||||
.map(|res, actor, _ctx| res.map(|release| actor.state.update_finalized(release)));
|
||||
|
||||
- Box::new(state_change)
|
||||
+ Box::pin(state_change)
|
||||
}
|
||||
|
||||
/// Actor job is done.
|
||||
@@ -253,7 +253,7 @@ impl UpdateAgent {
|
||||
Ok(())
|
||||
});
|
||||
|
||||
- Box::new(state_change)
|
||||
+ Box::pin(state_change)
|
||||
}
|
||||
|
||||
/// Fetch and stage an update, in finalization-locked mode.
|
||||
@@ -273,7 +273,7 @@ impl UpdateAgent {
|
||||
.map_err(|e| log::error!("failed to stage deployment: {}", e))
|
||||
.into_actor(self);
|
||||
|
||||
- Box::new(upgrade)
|
||||
+ Box::pin(upgrade)
|
||||
}
|
||||
|
||||
/// Record a failed deploy attempt.
|
||||
@@ -304,7 +304,7 @@ impl UpdateAgent {
|
||||
})
|
||||
.into_actor(self);
|
||||
|
||||
- Box::new(depls)
|
||||
+ Box::pin(depls)
|
||||
}
|
||||
|
||||
/// Finalize a deployment (unlock and reboot).
|
||||
@@ -314,7 +314,7 @@ impl UpdateAgent {
|
||||
release: Release,
|
||||
) -> ResponseActFuture<Self, Result<Release, ()>> {
|
||||
if !can_finalize {
|
||||
- return Box::new(actix::fut::err(()));
|
||||
+ return Box::pin(actix::fut::err(()));
|
||||
}
|
||||
|
||||
log::info!(
|
||||
@@ -329,12 +329,12 @@ impl UpdateAgent {
|
||||
.map_err(|e| log::error!("failed to finalize deployment: {}", e))
|
||||
.into_actor(self);
|
||||
|
||||
- Box::new(upgrade)
|
||||
+ Box::pin(upgrade)
|
||||
}
|
||||
|
||||
/// Do nothing, without errors.
|
||||
fn nop(&mut self) -> ResponseActFuture<Self, Result<(), ()>> {
|
||||
let nop = actix::fut::ok(());
|
||||
- Box::new(nop)
|
||||
+ Box::pin(nop)
|
||||
}
|
||||
}
|
||||
--
|
||||
2.28.0
|
||||
|
|
@ -16,6 +16,9 @@ Source: %{crates_source}
|
|||
# Initial patched metadata
|
||||
# - Update actix from ^0.9 to 0.10.0
|
||||
Patch0: zincati-fix-metadata.diff
|
||||
# Port to the new actix. Can drop after next upstream release.
|
||||
# https://github.com/coreos/zincati/commit/231d7cb
|
||||
Patch1: 0001-update_agent-adapt-to-actix-0.10-API-changes.patch
|
||||
|
||||
ExclusiveArch: %{rust_arches}
|
||||
|
||||
|
@ -79,9 +82,6 @@ License: ASL 2.0 and BSD and MIT and MPLv2.0 and zlib
|
|||
|
||||
%prep
|
||||
%autosetup -n %{crate}-%{version_no_tilde} -p1
|
||||
# Port to the new actix
|
||||
# No longer needed after https://github.com/coreos/zincati/pull/359
|
||||
sed -i -e "s/Box::new/Box::pin/g" src/update_agent/actor.rs
|
||||
%cargo_prep
|
||||
|
||||
%generate_buildrequires
|
||||
|
|
Loading…
Reference in New Issue