Commit 2fb8b607 authored by Adam Reese's avatar Adam Reese

fix(cmd): load client inside subcommand

parent 1ba822c7
...@@ -71,8 +71,8 @@ func newGetCmd(client helm.Interface, out io.Writer) *cobra.Command { ...@@ -71,8 +71,8 @@ func newGetCmd(client helm.Interface, out io.Writer) *cobra.Command {
return get.run() return get.run()
}, },
} }
cmd.AddCommand(newGetValuesCmd(client, out)) cmd.AddCommand(newGetValuesCmd(nil, out))
cmd.AddCommand(newGetManifestCmd(client, out)) cmd.AddCommand(newGetManifestCmd(nil, out))
return cmd return cmd
} }
......
...@@ -53,6 +53,9 @@ func newGetManifestCmd(client helm.Interface, out io.Writer) *cobra.Command { ...@@ -53,6 +53,9 @@ func newGetManifestCmd(client helm.Interface, out io.Writer) *cobra.Command {
return errReleaseRequired return errReleaseRequired
} }
get.release = args[0] get.release = args[0]
if get.client == nil {
get.client = helm.NewClient(helm.HelmHost(helm.Config.ServAddr))
}
return get.run() return get.run()
}, },
} }
...@@ -61,7 +64,7 @@ func newGetManifestCmd(client helm.Interface, out io.Writer) *cobra.Command { ...@@ -61,7 +64,7 @@ func newGetManifestCmd(client helm.Interface, out io.Writer) *cobra.Command {
// getManifest implements 'helm get manifest' // getManifest implements 'helm get manifest'
func (g *getManifestCmd) run() error { func (g *getManifestCmd) run() error {
res, err := helm.GetReleaseContent(g.release) res, err := g.client.ReleaseContent(g.release)
if err != nil { if err != nil {
return prettyError(err) return prettyError(err)
} }
......
...@@ -51,6 +51,9 @@ func newGetValuesCmd(client helm.Interface, out io.Writer) *cobra.Command { ...@@ -51,6 +51,9 @@ func newGetValuesCmd(client helm.Interface, out io.Writer) *cobra.Command {
return errReleaseRequired return errReleaseRequired
} }
get.release = args[0] get.release = args[0]
if get.client == nil {
get.client = helm.NewClient(helm.HelmHost(helm.Config.ServAddr))
}
return get.run() return get.run()
}, },
} }
......
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