diff --git a/cmd/helm/template.go b/cmd/helm/template.go index 5c4dca5ef..d3168c069 100644 --- a/cmd/helm/template.go +++ b/cmd/helm/template.go @@ -42,7 +42,7 @@ is done. To render just one template in a chart, use '-x': - $ helm template mychart -x templates/deployment.yaml + $ helm template foo mychart -x templates/deployment.yaml ` func newTemplateCmd(out io.Writer) *cobra.Command { @@ -59,10 +59,10 @@ func newTemplateCmd(out io.Writer) *cobra.Command { client := action.NewInstall(customConfig) cmd := &cobra.Command{ - Use: "template CHART", + Use: "template [NAME] [CHART]", Short: fmt.Sprintf("locally render templates"), Long: templateDesc, - Args: require.ExactArgs(1), + Args: require.MinimumNArgs(1), RunE: func(_ *cobra.Command, args []string) error { client.DryRun = true client.ReleaseName = "RELEASE-NAME" diff --git a/cmd/helm/testdata/output/template-no-args.txt b/cmd/helm/testdata/output/template-no-args.txt index 6a8a99505..f72f2b8cf 100644 --- a/cmd/helm/testdata/output/template-no-args.txt +++ b/cmd/helm/testdata/output/template-no-args.txt @@ -1,3 +1,3 @@ -Error: "helm template" requires 1 argument +Error: "helm template" requires at least 1 argument -Usage: helm template CHART [flags] +Usage: helm template [NAME] [CHART] [flags] diff --git a/pkg/releaseutil/manifest_sorter.go b/pkg/releaseutil/manifest_sorter.go index 531023481..41e501c9f 100644 --- a/pkg/releaseutil/manifest_sorter.go +++ b/pkg/releaseutil/manifest_sorter.go @@ -85,8 +85,7 @@ func SortManifests(files map[string]string, apis chartutil.VersionSet, sort Kind continue } // Skip empty files and log this. - if len(strings.TrimSpace(c)) == 0 { - log.Printf("info: manifest %q is empty. Skipping.", filePath) + if strings.TrimSpace(c) == "" { continue }