pull/3672/merge
Ali Rizwan 7 years ago committed by GitHub
commit 552d8ea4e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,6 +20,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"os"
"path/filepath" "path/filepath"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -78,7 +79,7 @@ func newCreateCmd(out io.Writer) *cobra.Command {
}, },
} }
cmd.Flags().StringVarP(&cc.starter, "starter", "p", "", "the named Helm starter scaffold") cmd.Flags().StringVarP(&cc.starter, "starter", "p", "", "the name or path of the Helm starter scaffold")
return cmd return cmd
} }
@ -97,6 +98,12 @@ func (c *createCmd) run() error {
if c.starter != "" { if c.starter != "" {
// Create from the starter // Create from the starter
lstarter := filepath.Join(c.home.Starters(), c.starter) lstarter := filepath.Join(c.home.Starters(), c.starter)
// Check without helm home
if _, err := os.Stat(lstarter); os.IsNotExist(err) {
if _, err := os.Stat(c.starter); err == nil {
lstarter = c.starter
}
}
return chartutil.CreateFrom(cfile, filepath.Dir(c.name), lstarter) return chartutil.CreateFrom(cfile, filepath.Dir(c.name), lstarter)
} }

@ -841,6 +841,7 @@ The `helm create` command takes an optional `--starter` option that lets you
specify a "starter chart". specify a "starter chart".
Starters are just regular charts, but are located in `$HELM_HOME/starters`. Starters are just regular charts, but are located in `$HELM_HOME/starters`.
You can specify the path to a starter using the `--starter` option.
As a chart developer, you may author charts that are specifically designed As a chart developer, you may author charts that are specifically designed
to be used as starters. Such charts should be designed with the following to be used as starters. Such charts should be designed with the following
considerations in mind: considerations in mind:
@ -851,6 +852,3 @@ considerations in mind:
- All occurrences of `<CHARTNAME>` will be replaced with the specified chart - All occurrences of `<CHARTNAME>` will be replaced with the specified chart
name so that starter charts can be used as templates. name so that starter charts can be used as templates.
Currently the only way to add a chart to `$HELM_HOME/starters` is to manually
copy it there. In your chart's documentation, you may want to explain that
process.

@ -37,7 +37,7 @@ helm create NAME
### Options ### Options
``` ```
-p, --starter string the named Helm starter scaffold -p, --starter string the name or path of the Helm starter scaffold
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
@ -54,4 +54,4 @@ helm create NAME
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 8-Mar-2018 ###### Auto generated by spf13/cobra on 14-Mar-2018

Loading…
Cancel
Save