DeleteDevcontainer deletes the provided devcontainer. This is a blocking call and will wait for the container to be deleted.
(ctx context.Context, devcontainerID string)
| 778 | // DeleteDevcontainer deletes the provided devcontainer. |
| 779 | // This is a blocking call and will wait for the container to be deleted. |
| 780 | func (c *agentConn) DeleteDevcontainer(ctx context.Context, devcontainerID string) error { |
| 781 | ctx, span := tracing.StartSpan(ctx) |
| 782 | defer span.End() |
| 783 | res, err := c.apiRequest(ctx, http.MethodDelete, "/api/v0/containers/devcontainers/"+devcontainerID, nil) |
| 784 | if err != nil { |
| 785 | return xerrors.Errorf("do request: %w", err) |
| 786 | } |
| 787 | defer res.Body.Close() |
| 788 | if res.StatusCode != http.StatusNoContent { |
| 789 | return codersdk.ReadBodyAsError(res) |
| 790 | } |
| 791 | return nil |
| 792 | } |
| 793 | |
| 794 | // RecreateDevcontainer recreates a devcontainer with the given container. |
| 795 | // This is a blocking call and will wait for the container to be recreated. |
nothing calls this directly
no test coverage detected