mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
Merge pull request #1250 from fibonacci1729/master
fix(1245): hook up revision flag to helm get {manifest,values,hooks}
This commit is contained in:
commit
0a4fa219dc
4 changed files with 12 additions and 4 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue