|
|
@ -48,14 +48,16 @@ Versioned chart archives are used by Helm package repositories.
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
type packageCmd struct {
|
|
|
|
type packageCmd struct {
|
|
|
|
save bool
|
|
|
|
save bool
|
|
|
|
sign bool
|
|
|
|
sign bool
|
|
|
|
path string
|
|
|
|
path string
|
|
|
|
key string
|
|
|
|
key string
|
|
|
|
keyring string
|
|
|
|
keyring string
|
|
|
|
version string
|
|
|
|
version string
|
|
|
|
out io.Writer
|
|
|
|
destination string
|
|
|
|
home helmpath.Home
|
|
|
|
|
|
|
|
|
|
|
|
out io.Writer
|
|
|
|
|
|
|
|
home helmpath.Home
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func newPackageCmd(out io.Writer) *cobra.Command {
|
|
|
|
func newPackageCmd(out io.Writer) *cobra.Command {
|
|
|
@ -96,6 +98,7 @@ func newPackageCmd(out io.Writer) *cobra.Command {
|
|
|
|
f.StringVar(&pkg.key, "key", "", "name of the key to use when signing. Used if --sign is true")
|
|
|
|
f.StringVar(&pkg.key, "key", "", "name of the key to use when signing. Used if --sign is true")
|
|
|
|
f.StringVar(&pkg.keyring, "keyring", defaultKeyring(), "location of a public keyring")
|
|
|
|
f.StringVar(&pkg.keyring, "keyring", defaultKeyring(), "location of a public keyring")
|
|
|
|
f.StringVar(&pkg.version, "version", "", "set the version on the chart to this semver version")
|
|
|
|
f.StringVar(&pkg.version, "version", "", "set the version on the chart to this semver version")
|
|
|
|
|
|
|
|
f.StringVarP(&pkg.destination, "destination", "d", ".", "location to write the chart.")
|
|
|
|
|
|
|
|
|
|
|
|
return cmd
|
|
|
|
return cmd
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -129,12 +132,19 @@ func (p *packageCmd) run(cmd *cobra.Command, args []string) error {
|
|
|
|
checkDependencies(ch, reqs, p.out)
|
|
|
|
checkDependencies(ch, reqs, p.out)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Save to the current working directory.
|
|
|
|
var dest string
|
|
|
|
cwd, err := os.Getwd()
|
|
|
|
if p.destination == "." {
|
|
|
|
if err != nil {
|
|
|
|
// Save to the current working directory.
|
|
|
|
return err
|
|
|
|
dest, err = os.Getwd()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// Otherwise save to set destination
|
|
|
|
|
|
|
|
dest = p.destination
|
|
|
|
}
|
|
|
|
}
|
|
|
|
name, err := chartutil.Save(ch, cwd)
|
|
|
|
|
|
|
|
|
|
|
|
name, err := chartutil.Save(ch, dest)
|
|
|
|
if err == nil && flagDebug {
|
|
|
|
if err == nil && flagDebug {
|
|
|
|
fmt.Fprintf(p.out, "Saved %s to current directory\n", name)
|
|
|
|
fmt.Fprintf(p.out, "Saved %s to current directory\n", name)
|
|
|
|
}
|
|
|
|
}
|
|
|
|