refactor: clarify prune scope, not system wide [ci skip]

This commit is contained in:
decentral1se 2023-02-17 11:09:44 +01:00
parent 4dbe1362a8
commit a6b5566fa6
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 5 additions and 5 deletions

View File

@ -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)
}
}