Commit 66e59f63 authored by Matt Butcher's avatar Matt Butcher

fix(helm): change 'helm update' to 'helm repo update'

The old form is marked deprecated.

Relates to #1196
parent 322b914b
...@@ -83,6 +83,9 @@ func newRootCmd(out io.Writer) *cobra.Command { ...@@ -83,6 +83,9 @@ func newRootCmd(out io.Writer) *cobra.Command {
p.StringVar(&tillerHost, "host", thost, "address of tiller. Overrides $HELM_HOST.") p.StringVar(&tillerHost, "host", thost, "address of tiller. Overrides $HELM_HOST.")
p.BoolVarP(&flagDebug, "debug", "", false, "enable verbose output") p.BoolVarP(&flagDebug, "debug", "", false, "enable verbose output")
rup := newRepoUpdateCmd(out)
rup.Deprecated = "use 'helm repo update'\n"
cmd.AddCommand( cmd.AddCommand(
newCreateCmd(out), newCreateCmd(out),
newDeleteCmd(nil, out), newDeleteCmd(nil, out),
...@@ -101,10 +104,11 @@ func newRootCmd(out io.Writer) *cobra.Command { ...@@ -101,10 +104,11 @@ func newRootCmd(out io.Writer) *cobra.Command {
newSearchCmd(out), newSearchCmd(out),
newServeCmd(out), newServeCmd(out),
newStatusCmd(nil, out), newStatusCmd(nil, out),
newUpdateCmd(out),
newUpgradeCmd(nil, out), newUpgradeCmd(nil, out),
newVerifyCmd(out), newVerifyCmd(out),
newVersionCmd(nil, out), newVersionCmd(nil, out),
// Deprecated
rup,
) )
return cmd return cmd
} }
......
...@@ -36,8 +36,8 @@ type repoCmd struct { ...@@ -36,8 +36,8 @@ type repoCmd struct {
func newRepoCmd(out io.Writer) *cobra.Command { func newRepoCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "repo [FLAGS] add|remove|list|index [ARGS]", Use: "repo [FLAGS] add|remove|list|index|update [ARGS]",
Short: "add, list, remove, index chart repositories", Short: "add, list, remove, update, and index chart repositories",
Long: repoHelm, Long: repoHelm,
} }
...@@ -45,6 +45,7 @@ func newRepoCmd(out io.Writer) *cobra.Command { ...@@ -45,6 +45,7 @@ func newRepoCmd(out io.Writer) *cobra.Command {
cmd.AddCommand(newRepoListCmd(out)) cmd.AddCommand(newRepoListCmd(out))
cmd.AddCommand(newRepoRemoveCmd(out)) cmd.AddCommand(newRepoRemoveCmd(out))
cmd.AddCommand(newRepoIndexCmd(out)) cmd.AddCommand(newRepoIndexCmd(out))
cmd.AddCommand(newRepoUpdateCmd(out))
return cmd return cmd
} }
...@@ -30,16 +30,19 @@ import ( ...@@ -30,16 +30,19 @@ import (
const updateDesc = ` const updateDesc = `
Update gets the latest information about charts from the respective chart repositories. Update gets the latest information about charts from the respective chart repositories.
Information is cached locally, where it is used by commands like 'helm search'. Information is cached locally, where it is used by commands like 'helm search'.
'helm update' is the deprecated form of 'helm repo update'. It will be removed in
future releases.
` `
type updateCmd struct { type repoUpdateCmd struct {
repoFile string repoFile string
update func(map[string]string, bool, io.Writer) update func(map[string]string, bool, io.Writer)
out io.Writer out io.Writer
} }
func newUpdateCmd(out io.Writer) *cobra.Command { func newRepoUpdateCmd(out io.Writer) *cobra.Command {
u := &updateCmd{ u := &repoUpdateCmd{
out: out, out: out,
update: updateCharts, update: updateCharts,
repoFile: repositoriesFile(), repoFile: repositoriesFile(),
...@@ -56,7 +59,7 @@ func newUpdateCmd(out io.Writer) *cobra.Command { ...@@ -56,7 +59,7 @@ func newUpdateCmd(out io.Writer) *cobra.Command {
return cmd return cmd
} }
func (u *updateCmd) run() error { func (u *repoUpdateCmd) run() error {
f, err := repo.LoadRepositoriesFile(u.repoFile) f, err := repo.LoadRepositoriesFile(u.repoFile)
if err != nil { if err != nil {
return err return err
......
...@@ -34,7 +34,7 @@ func TestUpdateCmd(t *testing.T) { ...@@ -34,7 +34,7 @@ func TestUpdateCmd(t *testing.T) {
fmt.Fprintln(out, name) fmt.Fprintln(out, name)
} }
} }
uc := &updateCmd{ uc := &repoUpdateCmd{
out: out, out: out,
update: updater, update: updater,
repoFile: "testdata/repositories.yaml", repoFile: "testdata/repositories.yaml",
......
...@@ -129,9 +129,9 @@ fantastic-charts https://storage.googleapis.com/fantastic-charts ...@@ -129,9 +129,9 @@ fantastic-charts https://storage.googleapis.com/fantastic-charts
*Note: A repository will not be added if it does not contain a valid index.yaml.* *Note: A repository will not be added if it does not contain a valid index.yaml.*
After that, they'll be able to search through your charts. After you've updated the repository, they can use the `helm update` command to get the latest chart information. After that, they'll be able to search through your charts. After you've updated the repository, they can use the `helm repo update` command to get the latest chart information.
*Under the hood, the `helm repo add` and `helm update` commands are fetching the index.yaml file and storing them in the `$HELM_HOME/repository/cache/` directory. This is where the `helm search` function finds information about charts.* *Under the hood, the `helm repo add` and `helm repo update` commands are fetching the index.yaml file and storing them in the `$HELM_HOME/repository/cache/` directory. This is where the `helm search` function finds information about charts.*
## Contributing charts to the official helm chart repository ## Contributing charts to the official helm chart repository
*Coming Soon* *Coming Soon*
...@@ -338,7 +338,7 @@ $ helm repo add dev https://example.com/dev-charts ...@@ -338,7 +338,7 @@ $ helm repo add dev https://example.com/dev-charts
``` ```
Because chart repositories change frequently, at any point you can make Because chart repositories change frequently, at any point you can make
sure your Helm client is up to date by running `helm update`. sure your Helm client is up to date by running `helm repo update`.
## Creating Your Own Charts ## Creating Your Own Charts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment