Manage empty image name

And avoid removing charts if there are problems before generating the
helm chart

fix #6
This commit is contained in:
2022-04-01 08:15:39 +02:00
parent 68a031d0be
commit 6cd1af015b
2 changed files with 20 additions and 4 deletions

View File

@@ -103,6 +103,10 @@ func Convert(composeFile, appVersion, appName, chartDir string, force bool) {
os.Exit(1)
}
// Parse the compose file now
p := compose.NewParser(composeFile)
p.Parse(appName)
dirname := filepath.Join(chartDir, appName)
if _, err := os.Stat(dirname); err == nil && !force {
response := ""
@@ -133,10 +137,6 @@ func Convert(composeFile, appVersion, appName, chartDir string, force bool) {
os.Exit(1)
}
// Parse the compose file now
p := compose.NewParser(composeFile)
p.Parse(appName)
// start generator
generator.Generate(p, Version, appName, appVersion, ComposeFile, dirname)