-
Notifications
You must be signed in to change notification settings - Fork 7
(fix) Delete App by path #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -897,15 +897,9 @@ func CloneApp( | |
|
|
||
| func DeleteApp(ctx context.Context, dockerClient command.Cli, app app.ArduinoApp) error { | ||
|
|
||
| runningApp, err := getRunningApp(ctx, dockerClient.Client()) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| if runningApp != nil && runningApp.FullPath.EqualsTo(app.FullPath) { | ||
| // We try to remove docker related resources at best effort | ||
| for range StopAndDestroyApp(ctx, dockerClient, app) { | ||
| // just consume the iterator | ||
| } | ||
| // We try to remove docker related resources at best effort | ||
| for range StopAndDestroyApp(ctx, dockerClient, app) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am wondering if we by default we should return an error if the app is running or if it has some data, and maybe have a parameter to force this behaviour
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was wondering whether it would be useful to add a parameter to make the command more customizable.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. already done here #170 |
||
| // just consume the iterator | ||
| } | ||
|
|
||
| return app.FullPath.RemoveAll() | ||
|
|
||