cli: add wait deployment subcommand#485
Draft
nikolasmatt wants to merge 5 commits into
Draft
Conversation
…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.
Collaborator
Author
|
Holding in draft pending #515. #515 changes
Will rebase and reopen for review once #515 merges. |
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.
Description
Adds
arctl wait deployment <name>. The command blocks until the deployment reaches a target state, then exits.Surface
--fordeployeddeployed,failed,undeployed,delete--timeout5m>0caps the wait,0polls once,<0waits forever--interval2s--tagExit
0on the requested state. Exit1on a different terminal state, not-found (when not waiting fordelete), or timeout. Progress lines on stderr, final state on stdout.Comparison to
kubectl waitkubectl waitarctl wait deploymentkubectl wait deployment/foo --for=condition=availablearctl wait deployment foo(default--for=deployed)kubectl wait pod/foo --for=deletearctl wait deployment foo --for=deletekubectl wait --for=jsonpath='{.status.phase}'=Running pod/fookubectl 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 deploymentkubectl wait --all deployment<resource>/<name>slash form<TYPE> <NAME>space form (matchesarctl get deployment/arctl delete deployment)Implementation
internal/cli/common/wait.go: replaces the previously unusedWaitForDeploymentReadywith an option-drivenWaitForDeployment(ctx, resolve, opts)and aWaitOptionsstruct (TargetStatus,TargetDeleted,Timeout,PollInterval,Progress).internal/cli/declarative/wait.go: new cobra subcommand, registered inpkg/cli/root.goalongsideGetCmd/DeleteCmd/ApplyCmd. Addresses deployments by target name with optional--tag, matchingget deployment/delete deployment.internal/cli/common/wait_test.goandinternal/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,--tagfilter, and rejection of non-deployment kinds.Change Type
/kind feature
Changelog