swarmctl: drop the controller socket target, the host has no socket to reach
This commit is contained in:
parent
64d340e385
commit
279f97e5ca
1 changed files with 174 additions and 599 deletions
|
|
@ -20,7 +20,7 @@ use serde::Deserialize;
|
|||
use swarm_controller_api::permissions::Permissions;
|
||||
|
||||
use crate::agent::send;
|
||||
use crate::remote::Target;
|
||||
use crate::remote::Swarm;
|
||||
|
||||
/// The manager agent the ceremony creates.
|
||||
const RUTH: &str = "ruth";
|
||||
|
|
@ -497,7 +497,7 @@ pub(crate) fn render(steps: &[Step], color: bool) -> String {
|
|||
/// host that lacks either still reports the steps that need neither. On a
|
||||
/// terminal, a `checking <what>…` line on stderr names the running check
|
||||
/// and is erased when the report prints; piped output carries only the report.
|
||||
pub(crate) fn status(target: &Result<Target>, users_file: &Result<std::path::PathBuf>) -> bool {
|
||||
pub(crate) fn status(target: &Result<Swarm>, users_file: &Result<std::path::PathBuf>) -> bool {
|
||||
use std::io::{IsTerminal as _, Write as _};
|
||||
|
||||
let live = std::io::stderr().is_terminal();
|
||||
|
|
@ -517,16 +517,13 @@ pub(crate) fn status(target: &Result<Target>, users_file: &Result<std::path::Pat
|
|||
|
||||
/// Run every check once. The inputs are borrowed so that `swarmctl setup` can
|
||||
/// look again after each step.
|
||||
pub(crate) fn observe(
|
||||
target: &Result<Target>,
|
||||
users_file: &Result<std::path::PathBuf>,
|
||||
) -> Observed {
|
||||
pub(crate) fn observe(target: &Result<Swarm>, users_file: &Result<std::path::PathBuf>) -> Observed {
|
||||
observe_with(target, users_file, &mut |_| {})
|
||||
}
|
||||
|
||||
/// [`observe`], calling `progress` with a name before each check starts.
|
||||
fn observe_with(
|
||||
target: &Result<Target>,
|
||||
target: &Result<Swarm>,
|
||||
users_file: &Result<std::path::PathBuf>,
|
||||
progress: &mut dyn FnMut(&str),
|
||||
) -> Observed {
|
||||
|
|
@ -758,7 +755,7 @@ fn has_admin_user(users_file: &Path) -> Result<bool> {
|
|||
}))
|
||||
}
|
||||
|
||||
fn agents(target: &Target) -> Result<Agents> {
|
||||
fn agents(target: &Swarm) -> Result<Agents> {
|
||||
let rt = tokio::runtime::Builder::new_current_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
|
|
@ -1072,7 +1069,7 @@ mod tests {
|
|||
granter: down("no unit"),
|
||||
policy_units: down("no units"),
|
||||
admin_user: down("no users file"),
|
||||
agents: down("no socket"),
|
||||
agents: down("not logged in"),
|
||||
};
|
||||
assert_eq!(
|
||||
kinds(&o),
|
||||
|
|
@ -1144,7 +1141,7 @@ next: step 6, setup.md § 2: `swarmctl user add <name> --email <address> --group
|
|||
#[test]
|
||||
fn the_header_counts_unknown_steps_apart_from_done_ones() {
|
||||
let mut o = pending();
|
||||
o.agents = Err("no socket".to_owned());
|
||||
o.agents = Err("not logged in".to_owned());
|
||||
let text = render(&classify(&o), false);
|
||||
assert!(
|
||||
text.starts_with("🏗️ setup: 5/8 steps done ██████░░░░ ❓ 4 unknown\n"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue