Watch
0
0
Fork
You've already forked hyperhive
0

drop the applied repo: the hive keeps no copy of an agent's config, only the deploy markers. Refs #5913

This commit is contained in:
damocles 2026-11-01 17:19:41 +01:00
commit 862495530c

View file

@ -68,7 +68,7 @@ pub(super) trait Host: Sync {
async fn notify(&self, key: String, summary: String);
/// Re-read the agent's archetype from the swarm.
async fn refresh_archetype(&self, name: &str) -> Result<()>;
/// Rebuild preamble: port check, applied repo and state dirs.
/// Rebuild preamble: port check and state dirs.
async fn prepare_rebuild_dirs(&self, name: &str, paths: &AgentPaths) -> Result<()>;
/// Rewrite the host-side files that follow the agent set.
async fn refresh_agent_set(&self) -> Result<()>;
@ -216,13 +216,11 @@ impl Host for RealHost {
fn purge_dirs(&self, name: &str) -> Vec<PathBuf> {
// A malformed name can't have a persistent state tree (the state dir is
// only ever created under a validated Ident), so only the applied dir
// is left to clear.
// only ever created under a validated Ident), so there is nothing to clear.
hive_types::Ident::parse(name)
.ok()
.map(|id| crate::paths::agent_state_dir(&id))
.into_iter()
.chain([crate::paths::applied_dir(name)])
.collect()
}
@ -426,7 +424,7 @@ async fn run_purge_state(host: &impl Host, agent: &str) {
// The state root may be a btrfs subvolume: a subvolume root can't be
// removed with rmdir/`remove_dir_all`, so delete it via hive-priv (root)
// first. No-op for plain-dir agents — the loop below then handles the
// plain-dir state root plus the applied dir.
// plain-dir state root.
if let Err(e) = host.delete_state_subvolume(agent).await {
tracing::warn!(error = ?e, %agent, "purge: delete state subvolume failed");
}
@ -731,8 +729,8 @@ async fn run_rebuild_bookkeeping(
Ok(())
}
/// First-spawn pre-create provisioning: the applied repo, state
/// subvolume, and the agent-set refresh.
/// First-spawn pre-create provisioning: the state subvolume and the
/// agent-set refresh.
async fn run_provision(host: &impl Host, name: &str) -> Result<()> {
let agent_dir = crate::paths::agent_runtime_dir(name);
let paths = Coordinator::agent_paths(name, agent_dir)?;