Skip to content

feat: add destroy#394

Open
miekg wants to merge 5 commits into
psviderski:mainfrom
miekg:miek/26/jun07zo/undeploy
Open

feat: add destroy#394
miekg wants to merge 5 commits into
psviderski:mainfrom
miekg:miek/26/jun07zo/undeploy

Conversation

@miekg

@miekg miekg commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

feat: add destroy

This adds destroy (aliases: down, undeploy) which calls out to client.RemoveService to remove services from the cluster. It is the opposite of "deploy" (which now has the alias "up")

This was mostly cut&paste of existing functionality.

Cancelling the operation:

% ~miekg/uncloud/cmd/uncloud/uc destroy
NAME    MODE     REPLICAS
unkey   global   3

Proceed with destroy? [y/N] n

Destroy cancelled. No changes were made.

Giving a service:

 ~miekg/uncloud/cmd/uncloud/uc destroy ds
 Error: select services: no such service: ds

Destroying takes place:

 NAME    MODE     REPLICAS
unkey   global   3

Proceed with destroy? [y/N] y

[+] Destroy service unkey 3/3
 ✔ Container unkey/cafab403586d on machine-11zv  Removed  3.9s
 ✔ Container unkey/f0773dc8c97d on machine-z00h  Removed  4.6s
 ✔ Container unkey/b1b428fabcd8 on machine-36i2  Removed  4.1s

Signed-off-by: Miek Gieben miek@miek.nl

@miekg

miekg commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

fixes: #369

@miekg

miekg commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Do we want to move this to a deployment plan thing? Or just call stop.Service which also has nice output. A deployment plan seems also a bit overkill as the plan is 'remove all containers'

@psviderski

Copy link
Copy Markdown
Owner

I'm a bit confused about what you want to actually achieve with the undeploy. From the issue discussion, I thought you basically want to remove all the services defined in your Compose file. Maybe destroy is a better name. This PR stops them. What's the practical use case?

For destructive operations we don't seem to have a consistent prompt. But I don't think we need anything fancy, just list the resources that will be removed like uc volume ls does.

@miekg

miekg commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

This PR stops them. What's the practical use case?

s/stops/remove

Thanks for the feedback, I'll move towards that.

@miekg miekg force-pushed the miek/26/jun07zo/undeploy branch from fb7662d to 9165f14 Compare June 9, 2026 08:27
This adds destroy (aliases: down, undeploy) which calls out to
client.RemoveService to remove services from the cluster. It is the
opposite of "deploy" (which now has the alias "up")

This was mostly cut&paste of existing functionality.

Cancelling the operation:

```
% ~miekg/uncloud/cmd/uncloud/uc destroy
NAME    MODE     REPLICAS
unkey   global   3

Proceed with destroy? [y/N] n

Destroy cancelled. No changes were made.
```

Giving a service:

```
 ~miekg/uncloud/cmd/uncloud/uc destroy ds
 Error: select services: no such service: ds
 ```

 Destroying takes place:
 ```

 ```
 NAME    MODE     REPLICAS
unkey   global   3

Proceed with destroy? [y/N] y

[+] Destroy service unkey 3/3
 ✔ Container unkey/cafab403586d on machine-11zv  Removed  3.9s
 ✔ Container unkey/f0773dc8c97d on machine-z00h  Removed  4.6s
 ✔ Container unkey/b1b428fabcd8 on machine-36i2  Removed  4.1s
 ```
Signed-off-by: Miek Gieben <miek@miek.nl>
@miekg miekg force-pushed the miek/26/jun07zo/undeploy branch from 9165f14 to 8b172e4 Compare June 9, 2026 08:29
Signed-off-by: Miek Gieben <miek@miek.nl>
@miekg miekg changed the title WIP: feat: add undeploy feat: add destroy Jun 9, 2026
miekg added 3 commits June 9, 2026 10:39
Signed-off-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Miek Gieben <miek@miek.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants