Skip to content

Commit

Permalink
feat: renamed delete environment to delete namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
vvagaytsev committed Jul 20, 2022
1 parent 03c5d7d commit ec72f9f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
23 changes: 11 additions & 12 deletions core/src/commands/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type DeleteSecretArgs = typeof deleteSecretArgs

export class DeleteSecretCommand extends Command<typeof deleteSecretArgs> {
name = "secret"
help = "Delete a secret from the environment."
help = "Delete a secret from the namespace."
protected = true

description = dedent`
Expand Down Expand Up @@ -82,7 +82,7 @@ const dependantsFirstOpt = {
"dependants-first": new BooleanParameter({
help: deline`
Delete services in reverse dependency order. That is, if service-a has a dependency on service-b, service-a
will be deleted before service-b when calling \`garden cleanup environment service-a,service-b --dependants-first\`.
will be deleted before service-b when calling \`garden cleanup namespace service-a,service-b --dependants-first\`.
When this flag is not used, all services in the project are deleted simultaneously.
`,
}),
Expand All @@ -98,35 +98,34 @@ interface DeleteEnvironmentResult {
}

export class DeleteEnvironmentCommand extends Command<{}, DeleteEnvironmentOpts> {
name = "environment"
alias = "env"
help = "Deletes a running environment."
name = "namespace"
alias = "ns"
help = "Deletes a running namespace."

protected = true
streamEvents = true

options = deleteEnvironmentOpts

description = dedent`
This will delete all services in the specified environment, and trigger providers to clear up any other resources
and reset it. When you then run \`garden deploy\`, the environment will be reconfigured.
This will delete all services in the specified namespace, and trigger providers to clear up any other resources
and reset it. When you then run \`garden deploy\`, the namespace will be reconfigured.
This can be useful if you find the environment to be in an inconsistent state, or need/want to free up
resources.
This can be useful if you find the namespace to be in an inconsistent state, or need/want to free up resources.
`

outputsSchema = () =>
joi.object().keys({
providerStatuses: joiIdentifierMap(environmentStatusSchema()).description(
"The status of each provider in the environment."
"The status of each provider in the namespace."
),
serviceStatuses: joiIdentifierMap(serviceStatusSchema()).description(
"The status of each service in the environment."
"The status of each service in the namespace."
),
})

printHeader({ headerLog }) {
printHeader(headerLog, `Cleanup environment`, "skull_and_crossbones")
printHeader(headerLog, `Cleanup namespace`, "skull_and_crossbones")
}

async action({
Expand Down
21 changes: 10 additions & 11 deletions docs/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ Examples:

### garden cleanup secret

**Delete a secret from the environment.**
**Delete a secret from the namespace.**

Returns with an error if the provided key could not be found by the provider.

Expand All @@ -396,30 +396,29 @@ Examples:



### garden cleanup environment
### garden cleanup namespace

**Deletes a running environment.**
**Deletes a running namespace.**

This will delete all services in the specified environment, and trigger providers to clear up any other resources
and reset it. When you then run `garden deploy`, the environment will be reconfigured.
This will delete all services in the specified namespace, and trigger providers to clear up any other resources
and reset it. When you then run `garden deploy`, the namespace will be reconfigured.

This can be useful if you find the environment to be in an inconsistent state, or need/want to free up
resources.
This can be useful if you find the namespace to be in an inconsistent state, or need/want to free up resources.

#### Usage

garden cleanup environment [options]
garden cleanup namespace [options]

#### Options

| Argument | Alias | Type | Description |
| -------- | ----- | ---- | ----------- |
| `--dependants-first` | | boolean | Delete services in reverse dependency order. That is, if service-a has a dependency on service-b, service-a will be deleted before service-b when calling &#x60;garden cleanup environment service-a,service-b --dependants-first&#x60;. When this flag is not used, all services in the project are deleted simultaneously.
| `--dependants-first` | | boolean | Delete services in reverse dependency order. That is, if service-a has a dependency on service-b, service-a will be deleted before service-b when calling &#x60;garden cleanup namespace service-a,service-b --dependants-first&#x60;. When this flag is not used, all services in the project are deleted simultaneously.

#### Outputs

```yaml
# The status of each provider in the environment.
# The status of each provider in the namespace.
providerStatuses:
# Description of an environment's status for a provider.
<name>:
Expand All @@ -445,7 +444,7 @@ providerStatuses:
# Set to true to disable caching of the status.
disableCache:
# The status of each service in the environment.
# The status of each service in the namespace.
serviceStatuses:
<name>:
# When the service was first deployed by the provider.
Expand Down

0 comments on commit ec72f9f

Please sign in to comment.