Watch
0
0
Fork
You've already forked hyperhive
0

agent ssh connections: declare per agent, render into the agent's ssh config

This commit is contained in:
atlas 2026-11-20 01:38:49 +01:00
commit 934da6f31f

View file

@ -11,6 +11,9 @@
//! ([`BEFORE_FIRST_READ`]), so a queue that is down at start never leaves it
//! wider than the swarm grants. After one, a set key wins, `[]` holds none and
//! an unset key is the default. A failed read keeps the last value.
//!
//! The same read renders the ssh connections into the agent's ssh config
//! ([`crate::ssh_connections`]).
use std::sync::{PoisonError, RwLock};
use std::time::Duration;
@ -68,8 +71,16 @@ pub async fn run() {
%agent,
"permissions: holding none (no bash) until the first read of this agent's key succeeds"
);
let mut ssh_applied = crate::ssh_connections::Applied::default();
loop {
let read = read_once(&client, &agent).await;
if let Some(Read::Current(record)) = &read {
crate::ssh_connections::apply(
record,
std::path::Path::new(crate::ssh_connections::CONFIG),
&mut ssh_applied,
);
}
{
let mut current = CURRENT.write().unwrap_or_else(PoisonError::into_inner);
let next = settle(current.clone(), read);