Repository navigation
feat(workflow): add enroll-netdev, enroll-fw and list commands - #9
Merged
Merged
Conversation
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
force-pushed
the
node-enroll-fw-netdev
branch
from
October 29, 2026 14:33
88b8b9e to
c4d16c4
Compare
haseebsyed12
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 forlabel,mac,switchandintf.workflow list: list workflows inargo-events, filtered by--template,--kind,--device-type,--target,--submitted-by,--statusand--selector. With no-o, it renders NAME / STATUS / AGE / DURATION itself (argo's table can't drop PRIORITY); an explicit-opasses through to argo.-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 withworkflows; skipped for IPs and single-label hosts).--lognow followsargo logsafter submit.understack.rackspace.com/targetandsubmitted-by.nodeis nowworkflow.Breaking change
understackctl node ...is removed; useunderstackctl workflow .... Thenode enroll-netdevandenroll-fwcommands were never released, so in practice this affectsenroll-serverandinspect-server.Dependencies
The
workflow-kindanddevice-typelabels come from the WorkflowTemplates: rackerlabs/understack#2612.--kindand--device-typeonly match once that is deployed; everything else works without it.Testing
go vetandgo test ./...pass. Not yet run against a live cluster: theargo submit/argo logs/argo list -o jsoncalls and the UI link are covered by unit tests of the argument and rendering logic only.