(ctx context.Context, namespace, name, currentUser string)
| 497 | } |
| 498 | |
| 499 | func (c *SpaceComponent) Delete(ctx context.Context, namespace, name, currentUser string) error { |
| 500 | space, err := c.ss.FindByPath(ctx, namespace, name) |
| 501 | if err != nil { |
| 502 | return fmt.Errorf("failed to find space, error: %w", err) |
| 503 | } |
| 504 | |
| 505 | deleteDatabaseRepoReq := types.DeleteRepoReq{ |
| 506 | Username: currentUser, |
| 507 | Namespace: namespace, |
| 508 | Name: name, |
| 509 | RepoType: types.SpaceRepo, |
| 510 | } |
| 511 | _, err = c.DeleteRepo(ctx, deleteDatabaseRepoReq) |
| 512 | if err != nil { |
| 513 | return fmt.Errorf("failed to delete repo of space, error: %w", err) |
| 514 | } |
| 515 | |
| 516 | err = c.ss.Delete(ctx, *space) |
| 517 | if err != nil { |
| 518 | return fmt.Errorf("failed to delete database space, error: %w", err) |
| 519 | } |
| 520 | |
| 521 | // stop any running space instance |
| 522 | go c.Stop(ctx, namespace, name) |
| 523 | |
| 524 | return nil |
| 525 | } |
| 526 | |
| 527 | func (c *SpaceComponent) Deploy(ctx context.Context, namespace, name, currentUser string) (int64, error) { |
| 528 | s, err := c.ss.FindByPath(ctx, namespace, name) |
nothing calls this directly
no test coverage detected