Skip to content

feat(workflow): add enroll-netdev, enroll-fw and list commands - #9

Merged
cardoe merged 5 commits into
mainfrom
node-enroll-fw-netdev
Oct 29, 2026
Merged

cardoe merged 5 commits into
mainfrom
node-enroll-fw-netdev

Conversation

@cardoe

@cardoe cardoe commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • workflow enroll-netdev / workflow enroll-fw: submit the matching WorkflowTemplates with typed flags. Ports come from --ports (JSON) or --ports-file (YAML or JSON) and are validated for label, mac, switch and intf.
  • workflow list: list workflows in argo-events, filtered by --template, --kind, --device-type, --target, --submitted-by, --status and --selector. With no -o, it renders NAME / STATUS / AGE / DURATION itself (argo's table can't drop PRIORITY); an explicit -o passes through to argo.
  • Submission: all commands submit with -o name, print the workflow name, and print an Argo UI link built from the current context's API server host (left-most label replaced with workflows; skipped for IPs and single-label hosts). --log now follows argo logs after submit.
  • Labels: submitted workflows get understack.rackspace.com/target and submitted-by.
  • Rename: node is now workflow.

Breaking change

understackctl node ... is removed; use understackctl workflow .... The node enroll-netdev and enroll-fw commands were never released, so in practice this affects enroll-server and inspect-server.

Dependencies

The workflow-kind and device-type labels come from the WorkflowTemplates: rackerlabs/understack#2612. --kind and --device-type only match once that is deployed; everything else works without it.

Testing

go vet and go test ./... pass. Not yet run against a live cluster: the argo submit / argo logs / argo list -o json calls and the UI link are covered by unit tests of the argument and rendering logic only.

Move `argo submit` handling into a shared submitWorkflow helper used by
enroll-server and inspect-server. Submit with `-o name` so the generated
workflow name is captured and printed, and follow logs with `argo logs
--follow <name>` when --log is set rather than relying on `argo submit
--log`.

Also print an Argo UI link derived from the current kube context's API
server URL by replacing the left-most hostname label with "workflows".
The link is skipped when the host is an IP address or has no domain.
Add `node enroll-netdev` and `node enroll-fw` to submit the matching
Argo WorkflowTemplates with typed flags instead of hand-built `-p`
parameters.

Ports are supplied with --ports (JSON) or --ports-file (YAML or JSON),
are validated for the required label, mac, switch and intf keys, and are
passed to the workflow as compact JSON. enroll-fw shares the netdev flags
and adds the firewall management and identity flags; optional flags are
only sent when set so the template defaults still apply.
Stamp each submitted workflow with understack.rackspace.com/target (the
IP address, node name or node ID it was submitted for) and
understack.rackspace.com/submitted-by (the local user), so runs can be
found with `argo list -l`. Values are sanitized to fit Kubernetes label
rules: invalid characters become '-', values are cut to 63 characters,
and leading and trailing punctuation is trimmed.

The workflow-kind and device-type labels are set by the WorkflowTemplates
themselves.
The command wraps Argo workflows, not only node operations, so name it
for what it does. `understackctl node <subcommand>` becomes
`understackctl workflow <subcommand>`; the subcommands are unchanged.
The package moves from cmd/node to cmd/workflow.

BREAKING CHANGE: `understackctl node ...` is removed; use
`understackctl workflow ...`.
Add `workflow list`, which lists Argo workflows in the argo-events
namespace and filters them by the labels UnderStack stamps on them:
--kind, --device-type, --target and --submitted-by. Also filter by
--template (the WorkflowTemplate name, repeatable or comma separated),
--status, and an extra --selector.

With no -o, fetch `argo list -o json` and render NAME, STATUS, AGE and
DURATION ourselves, newest first, because argo's table cannot drop its
PRIORITY column. An explicit -o is passed straight through to argo.
@cardoe
cardoe force-pushed the node-enroll-fw-netdev branch from 88b8b9e to c4d16c4 Compare October 29, 2026 14:33
@cardoe
cardoe merged commit 54c53f3 into main Oct 29, 2026
8 checks passed
@cardoe
cardoe deleted the node-enroll-fw-netdev branch October 29, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants