Skip to content

cli: add wait deployment subcommand#485

Draft
nikolasmatt wants to merge 5 commits into
agentregistry-dev:mainfrom
nikolasmatt:nikolasmatt/arctl-deployment-wait
Draft

cli: add wait deployment subcommand#485
nikolasmatt wants to merge 5 commits into
agentregistry-dev:mainfrom
nikolasmatt:nikolasmatt/arctl-deployment-wait

Conversation

@nikolasmatt
Copy link
Copy Markdown
Collaborator

@nikolasmatt nikolasmatt commented May 11, 2026

Description

Adds arctl wait deployment <name>. The command blocks until the deployment reaches a target state, then exits.

Surface

arctl wait deployment <name> [--for=<state>] [--timeout=<duration>] [--interval=<duration>] [--tag <tag>]
Flag Default Values
--for deployed deployed, failed, undeployed, delete
--timeout 5m >0 caps the wait, 0 polls once, <0 waits forever
--interval 2s poll cadence
--tag (any) restrict to one target tag

Exit 0 on the requested state. Exit 1 on a different terminal state, not-found (when not waiting for delete), or timeout. Progress lines on stderr, final state on stdout.

Comparison to kubectl wait

kubectl wait arctl wait deployment
kubectl wait deployment/foo --for=condition=available arctl wait deployment foo (default --for=deployed)
kubectl wait pod/foo --for=delete arctl wait deployment foo --for=delete
kubectl wait --for=jsonpath='{.status.phase}'=Running pod/foo not supported — deployment status is a flat string projection, not v1alpha1 conditions
kubectl wait pod/foo --timeout=30s (default 30s) arctl wait deployment foo --timeout=5m (default 5m; AgentCore cold-builds run minutes)
kubectl wait --timeout=0 (poll once) arctl wait deployment foo --timeout=0 (same)
kubectl wait --timeout=-1s (wait forever) arctl wait deployment foo --timeout=-1s (same)
kubectl wait -l app=foo deployment not supported (deployments addressed by target name only)
kubectl wait --all deployment not supported
<resource>/<name> slash form <TYPE> <NAME> space form (matches arctl get deployment / arctl delete deployment)

Implementation

  • internal/cli/common/wait.go: replaces the previously unused WaitForDeploymentReady with an option-driven WaitForDeployment(ctx, resolve, opts) and a WaitOptions struct (TargetStatus, TargetDeleted, Timeout, PollInterval, Progress).
  • internal/cli/declarative/wait.go: new cobra subcommand, registered in pkg/cli/root.go alongside GetCmd / DeleteCmd / ApplyCmd. Addresses deployments by target name with optional --tag, matching get deployment / delete deployment.
  • internal/cli/common/wait_test.go and internal/cli/declarative/deployment_wait_test.go: helper-level and end-to-end tests for the success path, terminal-mismatch failure, --for=failed, --for=delete, not-found, timeout, one-shot, context cancellation, --tag filter, and rejection of non-deployment kinds.

Change Type

/kind feature

Changelog

Add `arctl wait deployment <name>` to block until a deployment reaches a target state. Supports `--for=deployed|failed|undeployed|delete`, `--timeout`, `--interval`, and `--tag`.

…eployment-wait

# Conflicts:
#	pkg/cli/root.go
WaitForDeployment now preserves typed not-found errors across its
return path and asserts the resolver's no-(nil,nil) contract. arctl
wait rejects unknown --for values up front instead of waiting until
the deployment hits any terminal state, and errors on ambiguous
target names when --tag is omitted.
@nikolasmatt nikolasmatt marked this pull request as ready for review May 22, 2026 20:51
@nikolasmatt nikolasmatt marked this pull request as draft May 22, 2026 20:54
@nikolasmatt
Copy link
Copy Markdown
Collaborator Author

Holding in draft pending #515.

#515 changes arctl get/delete deployment to address by deployment record name (e.g. aws-v1) instead of target name (e.g. summarizer). Once it lands, this branch needs a follow-up:

  • Rewrite resolveDeploymentForWait to use client.GetTyped instead of ListDeployments-then-filter.
  • Drop --tag; deployment record names are unique, so it's no longer meaningful.
  • Remove the multi-match ambiguity error and TestDeploymentWait_AmbiguousTargetWithoutTag; the case can't occur.
  • Update the PR body's kubectl wait comparison table to match the new addressing convention.

Will rebase and reopen for review once #515 merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant