Merge pull request #5472 from adamreese/v3/template-name

fix(cmd/template): allow setting release name for template
pull/5283/head
Adam Reese 6 years ago committed by GitHub
commit 779373a276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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"

@ -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]

@ -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
}

Loading…
Cancel
Save