diff --git a/helm/types.go b/helm/types.go index e00b3d6..bd2d717 100644 --- a/helm/types.go +++ b/helm/types.go @@ -54,7 +54,7 @@ func NewBase() *K8sBase { b := &K8sBase{ Metadata: NewMetadata(), } - b.Metadata.Labels[K+"/project"] = getProjectName() + b.Metadata.Labels[K+"/project"] = GetProjectName() b.Metadata.Labels[K+"/release"] = "{{ .Release.Name }}" b.Metadata.Annotations[K+"/version"] = Version return b @@ -70,7 +70,7 @@ func (k K8sBase) Get() string { return k.Kind } -func getProjectName() string { +func GetProjectName() string { if len(Appname) > 0 { return Appname } diff --git a/main.go b/main.go index 39fbaf2..915afc9 100644 --- a/main.go +++ b/main.go @@ -23,7 +23,7 @@ var ChartsDir = "chart" func main() { flag.StringVar(&ChartsDir, "chart-dir", ChartsDir, "set the chart directory") flag.StringVar(&ComposeFile, "compose", ComposeFile, "set the compose file to parse") - flag.StringVar(&AppName, "appname", AppName, "sive the helm chart app name") + flag.StringVar(&AppName, "appname", helm.GetProjectName(), "set the helm chart app name") flag.StringVar(&AppVersion, "appversion", AppVersion, "set the chart appVersion") version := flag.Bool("version", false, "Show version and exit") force := flag.Bool("force", false, "force the removal of the chart-dir")