Skip to content

stackyard fleet --json and stackyard audit --json #2

Open

Description

@apankov

./stack list and ./stack --check answer in JSON with --json (v0.31.0), so an agent or a monitor can read them without parsing text. The two fleet-wide commands cannot yet.

What to build:

  • stackyard fleet --json: {"stackyard":{"version","commit"},"machines":[{"name","path","version","commit","behind"}]} — behind a number, or null when it cannot be counted.
  • stackyard audit --json: the same shape ./stack --check --json uses — {"command","ok","problems","warnings","findings":[{"section","level","message"}]}.
  • In both, stdout carries the JSON and nothing else; the exit code keeps its meaning.

Where to look:

  • platform/lib/lib-env.sh, the JSON section: json_str, json_list, json_finding, json_findings_object, written without jq.
  • platform/bin/stack.sh: how --json moves the human report to stderr (exec 3>&1 1>&2) and records findings in ok/warn/bad.
  • bin/fleet.sh, bin/audit-isolation.sh.

Done when: selftest parses both outputs with a real JSON parser (see the "== --json" block) and compares the counts with the findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions