fix(947): strip prose/issue-tags from agent_sockets.rs
This commit is contained in:
parent
7af29b3249
commit
e7a5718e83
1 changed files with 8 additions and 14 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
//! `/var/lib/hyperhive/agent-sockets.json` writer. Sibling to
|
//! `/var/lib/hyperhive/agent-sockets.json` writer. Sibling to
|
||||||
//! `agent_ports.rs`; same atomic `<path>.tmp` + `rename()` shape so
|
//! `agent_ports.rs`; same atomic `<path>.tmp` + `rename()` shape so
|
||||||
//! the gateway's nginx worker never reads a partial file. Manager
|
//! the gateway's nginx worker never reads a partial file. Includes
|
||||||
//! excluded from the map (manager UI routes via the dashboard
|
//! manager and sub-agents so the gateway can route
|
||||||
//! upstream, not per-agent `/agent/<name>/`).
|
//! `/agent/<name>/` for all containers with a bound unix socket.
|
||||||
//!
|
//!
|
||||||
//! Full mechanism — per-agent subdir bind-mount, `hyperhive-socket-bound`
|
//! Full mechanism — per-agent subdir bind-mount, `hyperhive-socket-bound`
|
||||||
//! marker gate, gateway UDS upstream, transition vs `agent-ports.json`,
|
//! marker gate, gateway UDS upstream, transition vs `agent-ports.json`,
|
||||||
|
|
@ -38,7 +38,7 @@ pub const SOCKET_FILENAME: &str = "web.sock";
|
||||||
/// sub-agent that hasn't flipped the option yet.
|
/// sub-agent that hasn't flipped the option yet.
|
||||||
///
|
///
|
||||||
/// Renamed from `.bound` (legacy) to match the `hyperhive-` prefix
|
/// Renamed from `.bound` (legacy) to match the `hyperhive-` prefix
|
||||||
/// convention for all harness-written state files (#838). `build_map`
|
/// convention for all harness-written state files. `build_map`
|
||||||
/// checks both names during the transition window so existing containers
|
/// checks both names during the transition window so existing containers
|
||||||
/// don't lose gateway routing before their next rebuild.
|
/// don't lose gateway routing before their next rebuild.
|
||||||
pub const READY_MARKER: &str = "hyperhive-socket-bound";
|
pub const READY_MARKER: &str = "hyperhive-socket-bound";
|
||||||
|
|
@ -67,11 +67,9 @@ pub fn socket_path_for(name: &str) -> PathBuf {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compute the agent-socket map for the given logical agent names.
|
/// Compute the agent-socket map for the given logical agent names.
|
||||||
/// Includes manager and sub-agents — all managed containers that have
|
/// Includes manager and sub-agents. Filters by `READY_MARKER`
|
||||||
/// bound a unix socket get an entry. Filters by `READY_MARKER` presence:
|
/// presence: only agents whose harness has actually bound the unix
|
||||||
/// only agents whose
|
/// socket appear in the map. Without this, the gateway would
|
||||||
/// harness has actually bound the unix socket (and dropped the
|
|
||||||
/// marker) appear in the map. Without this, the gateway would
|
|
||||||
/// `proxy_pass` to a non-existent socket for every sub-agent that
|
/// `proxy_pass` to a non-existent socket for every sub-agent that
|
||||||
/// hasn't yet flipped `hyperhive.web.useUnixSocket = true`.
|
/// hasn't yet flipped `hyperhive.web.useUnixSocket = true`.
|
||||||
///
|
///
|
||||||
|
|
@ -238,11 +236,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn build_map_includes_manager() {
|
fn build_map_includes_manager() {
|
||||||
// Manager is now included in the gateway socket map so the
|
|
||||||
// gateway can route `/agent/<manager-name>/` to its unix socket,
|
|
||||||
// giving the operator access to the manager's per-agent web UI
|
|
||||||
// (terminal, inbox, stats). All-ready predicate bypasses the
|
|
||||||
// marker check so we exercise the manager inclusion in isolation.
|
|
||||||
let names: Vec<String> = ["iris", MANAGER_NAME, "argus"]
|
let names: Vec<String> = ["iris", MANAGER_NAME, "argus"]
|
||||||
.iter()
|
.iter()
|
||||||
.map(|s| (*s).to_owned())
|
.map(|s| (*s).to_owned())
|
||||||
|
|
@ -339,3 +332,4 @@ mod tests {
|
||||||
assert!(body.contains("\"/run/hive-agent/iris/web.sock\""));
|
assert!(body.contains("\"/run/hive-agent/iris/web.sock\""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue