Repository navigation
Add service delete and project delete --cascade - #23
Merged
Merged
Conversation
valar service delete [--yes] [service] deletes a service with everything
it holds, defaulting to the service in .valar.yml. valar project delete
--cascade deletes a project's services and domain claims before the
project itself.
Both ask for the name to confirm unless --yes is given, and refuse with
exit code 2 when standard input is not a terminal. Plain project delete
still accepts the name from piped input. A 409 or 5xx answer is retried
with a short backoff; a 404 on a retry counts as done, while a 404 on the
first attempt exits with 3. With --json they print
{"service": ..., "deleted": true} or {"project": ..., "deleted": true}.
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.
Adds deletion of services, and of non-empty projects.
valar service delete [--yes] [service]deletes a service with its builds, deployments, batch executions, environment, secrets, schedules and permission rules. The service defaults to the one in.valar.yml.valar project delete --cascade namedeletes the project's services and domain claims, then the project. Without--cascadethe command behaves as before.Both ask for the name to confirm unless
--yesis given. With no terminal on standard input they refuse with exit code 2 instead of waiting; plainproject deletestill accepts the name from piped input, as it did.A 409 or 5xx answer is retried up to three times with a 1s/2s/4s backoff, since repeating a failed deletion finishes it. A 404 on a retry means an earlier attempt completed, so it counts as success; a 404 on the first attempt exits with code 3. Project deletion without
--cascadeis not retried: a 409 there means the project isn't empty.With
--jsonthe commands print{"service": "...", "deleted": true}or{"project": "...", "deleted": true}. The project result key changes fromnametoproject; JSON output has not been released yet.Tests cover confirmation,
--yes, the refusal without a terminal, 404, retry-then-404, 409 retries, and JSON output through the root command.