mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 14:01:54 +02:00
Implement temp file cleanup for chartify and helmfile temp files
Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
This commit is contained in:
co-authored by
yxxhero
parent
3ce5abcc4f
commit
53ee477e20
@@ -68,6 +68,14 @@ func NewRootCmd(globalConfig *config.GlobalOptions) (*cobra.Command, error) {
|
||||
}
|
||||
logger = helmexec.NewLogger(logOut, logLevel)
|
||||
globalConfig.SetLogger(logger)
|
||||
|
||||
// Clean up old temporary files if enabled
|
||||
if globalConfig.CleanupTempFiles {
|
||||
if err := app.CleanupTempFiles(logger); err != nil {
|
||||
logger.Warnf("Failed to cleanup temporary files: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
@@ -141,6 +149,7 @@ The name of a release can be used as a label: "--selector name=myrelease"`)
|
||||
fs.BoolVar(&globalOptions.EnableLiveOutput, "enable-live-output", globalOptions.EnableLiveOutput, `Show live output from the Helm binary Stdout/Stderr into Helmfile own Stdout/Stderr.
|
||||
It only applies for the Helm CLI commands, Stdout/Stderr for Hooks are still displayed only when it's execution finishes.`)
|
||||
fs.BoolVarP(&globalOptions.Interactive, "interactive", "i", false, "Request confirmation before attempting to modify clusters")
|
||||
fs.BoolVar(&globalOptions.CleanupTempFiles, "cleanup-temp-files", true, "Clean up temporary files and directories from previous runs on startup")
|
||||
// avoid 'pflag: help requested' error (#251)
|
||||
fs.BoolP("help", "h", false, "help for helmfile")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user