build image log fix#1375
Conversation
|
/run-security-scan |
alexcos20
left a comment
There was a problem hiding this comment.
AI automated code review (Gemini 3).
Overall risk: low
Summary:
This PR updates the C2D Docker engine to correctly resolve the image.log file path using getStoragePath() rather than a hardcoded reference to tempFolder. The unit tests have been updated accordingly to mirror this logic. Overall, the logic is sound and correctly addresses path resolution inconsistencies. LGTM!
Comments:
• [INFO][style] Consider using path.join instead of string concatenation for constructing file paths. This ensures better cross-platform compatibility and avoids subtle bugs with missing or duplicate directory separators.
- const imageLogFile = this.getStoragePath() + '/' + job.jobId + '/data/logs/image.log'
+ const imageLogFile = path.join(this.getStoragePath(), job.jobId, 'data', 'logs', 'image.log')(Ensure path is imported at the top of the file if you apply this change).
• [INFO][other] Good job dynamically fetching the expected storage path from the engine instance rather than hardcoding the temp folder. This keeps the test robust against future underlying path logic changes.

Fixes # .
Changes proposed in this PR:
BuildImage builds its log file path from tempFolder instead of getStoragePath() (which is tempFolder + clusterHash). The job folder is created under getStoragePath(), so writes target a non-existent directory.
Fix