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