refactor: clarify prune scope, not system wide [ci skip]
This commit is contained in:
parent
4dbe1362a8
commit
a6b5566fa6
@ -24,10 +24,10 @@ var pruneFlag = &cli.BoolFlag{
|
||||
Usage: "Prunes unused containers, networks, and dangling images for an app",
|
||||
}
|
||||
|
||||
// pruneSystem runs the equivalent of a "docker system prune" after an undeploy
|
||||
// in order to clean up left over state related to the deployment. Volumes are
|
||||
// not pruned to avoid unwated data loss.
|
||||
func pruneSystem(c *cli.Context, cl *dockerClient.Client, app config.App) error {
|
||||
// pruneApp runs the equivalent of a "docker system prune" but only filtering
|
||||
// against resources connected with the app deployment. It is not a system wide
|
||||
// prune. Volumes are not pruned to avoid unwated data loss.
|
||||
func pruneApp(c *cli.Context, cl *dockerClient.Client, app config.App) error {
|
||||
stackName := app.StackName()
|
||||
ctx := context.Background()
|
||||
|
||||
@ -123,7 +123,7 @@ Passing "-p/--prune" does not remove those volumes.
|
||||
}
|
||||
|
||||
if prune {
|
||||
if err := pruneSystem(c, cl, app); err != nil {
|
||||
if err := pruneApp(c, cl, app); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user