From 72df0310ae74a16cf8c22fe02e9c75ef4718f568 Mon Sep 17 00:00:00 2001 From: NoamSDahan Date: Wed, 27 Sep 2023 12:17:59 +0300 Subject: [PATCH] - Fixed bug: clean with filter flags cleaned all scenarios --- cmd/commands/clean.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/commands/clean.go b/cmd/commands/clean.go index 7c1faf7..a512d3a 100644 --- a/cmd/commands/clean.go +++ b/cmd/commands/clean.go @@ -17,7 +17,7 @@ var CleanCommand = &cli.Command{ moduleTable := c.Context.Value("CNAPPgoatModuleTable").(table.Writer) engine := c.Context.Value("CNAPPgoatEngine").(*cnappgoat.Engine) reg := c.Context.Value("CNAPPgoatModuleRegistry").(*cnappgoat.Registry) - if c.Args().Len() == 0 { + if c.Args().Len() == 0 && c.String("module") == "" && c.String("platform") == "" && c.String("state") == "" { if err := engine.CleanAll(c.Context, c.Bool("force")); err != nil { return err }