swarm: seed power intent to Up on first-deploy so the container actually starts
This commit is contained in:
parent
c48c8b1991
commit
3f98bfb09d
1 changed files with 14 additions and 0 deletions
|
|
@ -279,6 +279,20 @@ async fn handle_deploy_request(
|
||||||
// repo and its config; what is left is hive-local, and there is no
|
// repo and its config; what is left is hive-local, and there is no
|
||||||
// approval to wait on because the operator's click at swarm level is
|
// approval to wait on because the operator's click at swarm level is
|
||||||
// the authorisation.
|
// the authorisation.
|
||||||
|
//
|
||||||
|
// Seed the power intent to `Up` before queuing, same as
|
||||||
|
// `actions::approve`'s `ApprovalKind::Spawn` arm does for the
|
||||||
|
// operator-approved path: `first_deploy`'s tail `Reconcile` node
|
||||||
|
// seeds `Wanted` from the container's *currently observed* running
|
||||||
|
// state when no row exists yet (`power::Store::get_or_seed`), and at
|
||||||
|
// that point in a first deploy the container is freshly created but
|
||||||
|
// not yet started — so an unseeded row locks the agent's wanted
|
||||||
|
// state to `Offline` on its very first reconcile, and `Reconcile`
|
||||||
|
// never emits the `Start` node. Setting the row up front here closes
|
||||||
|
// that window the same way the approval path already does.
|
||||||
|
if let Err(e) = coord.power.set(&agent, crate::power::Wanted::Up) {
|
||||||
|
tracing::warn!(%agent, error = ?e, "agent_power: seed on swarm first-deploy failed");
|
||||||
|
}
|
||||||
coord
|
coord
|
||||||
.job_queue
|
.job_queue
|
||||||
.insert_job(|b| crate::job_queue::templates::first_deploy(b, &agent))
|
.insert_job(|b| crate::job_queue::templates::first_deploy(b, &agent))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue