Commit 0a4fa219 authored by Brian's avatar Brian Committed by GitHub

Merge pull request #1250 from fibonacci1729/master

fix(1245): hook up revision flag to helm get {manifest,values,hooks}
parents 715be826 9cfbbb34
......@@ -73,7 +73,7 @@ func newGetCmd(client helm.Interface, out io.Writer) *cobra.Command {
},
}
cmd.PersistentFlags().Int32Var(&get.version, "revision", 0, "get the named release with revision")
cmd.Flags().Int32Var(&get.version, "revision", 0, "get the named release with revision")
cmd.AddCommand(newGetValuesCmd(nil, out))
cmd.AddCommand(newGetManifestCmd(nil, out))
......
......@@ -35,6 +35,7 @@ type getHooksCmd struct {
release string
out io.Writer
client helm.Interface
version int32
}
func newGetHooksCmd(client helm.Interface, out io.Writer) *cobra.Command {
......@@ -55,11 +56,12 @@ func newGetHooksCmd(client helm.Interface, out io.Writer) *cobra.Command {
return ghc.run()
},
}
cmd.Flags().Int32Var(&ghc.version, "revision", 0, "get the named release with revision")
return cmd
}
func (g *getHooksCmd) run() error {
res, err := g.client.ReleaseContent(g.release)
res, err := g.client.ReleaseContent(g.release, helm.ContentReleaseVersion(g.version))
if err != nil {
fmt.Fprintln(g.out, g.release)
return prettyError(err)
......
......@@ -37,6 +37,7 @@ type getManifestCmd struct {
release string
out io.Writer
client helm.Interface
version int32
}
func newGetManifestCmd(client helm.Interface, out io.Writer) *cobra.Command {
......@@ -59,12 +60,14 @@ func newGetManifestCmd(client helm.Interface, out io.Writer) *cobra.Command {
return get.run()
},
}
cmd.Flags().Int32Var(&get.version, "revision", 0, "get the named release with revision")
return cmd
}
// getManifest implements 'helm get manifest'
func (g *getManifestCmd) run() error {
res, err := g.client.ReleaseContent(g.release)
res, err := g.client.ReleaseContent(g.release, helm.ContentReleaseVersion(g.version))
if err != nil {
return prettyError(err)
}
......
......@@ -35,6 +35,7 @@ type getValuesCmd struct {
allValues bool
out io.Writer
client helm.Interface
version int32
}
func newGetValuesCmd(client helm.Interface, out io.Writer) *cobra.Command {
......@@ -55,13 +56,15 @@ func newGetValuesCmd(client helm.Interface, out io.Writer) *cobra.Command {
return get.run()
},
}
cmd.Flags().Int32Var(&get.version, "revision", 0, "get the named release with revision")
cmd.Flags().BoolVarP(&get.allValues, "all", "a", false, "dump all (computed) values")
return cmd
}
// getValues implements 'helm get values'
func (g *getValuesCmd) run() error {
res, err := g.client.ReleaseContent(g.release)
res, err := g.client.ReleaseContent(g.release, helm.ContentReleaseVersion(g.version))
if err != nil {
return prettyError(err)
}
......
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