Skip to content

Commit a413a91

Browse files
author
Checkmarx Automation
committed
Refactor cleanup logic in containerScanner: Remove deletion of .checkmarx containers folder. The caller (AST CLI) will now handle cleanup after processing the container-resolution.json file.
1 parent a1136a7 commit a413a91

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

pkg/containerResolver/containerScanner.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,12 @@ func cleanup(originalPath string, outputPath string, checkmarxPath string) error
116116
}
117117
}
118118

119-
// Clean up containers folder inside .checkmarx if checkmarxPath is provided
120-
if checkmarxPath != "" {
121-
// checkmarxPath points to .checkmarx/containers, so we delete this directory
122-
cxErr := imagesExtractor.DeleteDirectory(checkmarxPath)
123-
if cxErr != nil {
124-
log.Warn().Err(cxErr).Msg("Could not delete containers directory inside .checkmarx folder")
125-
}
126-
}
119+
// Note: We no longer clean up the containers folder inside .checkmarx here
120+
// as the caller (AST CLI) needs the container-resolution.json file for further processing.
121+
// The cleanup of .checkmarx/containers should be handled by the caller after it has
122+
// processed the resolution file.
127123

128-
// Only return error from output directory cleanup, not from .checkmarx cleanup
124+
// Only return error from output directory cleanup
129125
return err
130126
}
131127

0 commit comments

Comments
 (0)