fix(cmd): load client inside subcommand

pull/921/head
Adam Reese 9 years ago
parent 1ba822c7a4
commit 2fb8b60765

@ -71,8 +71,8 @@ func newGetCmd(client helm.Interface, out io.Writer) *cobra.Command {
return get.run()
},
}
cmd.AddCommand(newGetValuesCmd(client, out))
cmd.AddCommand(newGetManifestCmd(client, out))
cmd.AddCommand(newGetValuesCmd(nil, out))
cmd.AddCommand(newGetManifestCmd(nil, out))
return cmd
}

@ -53,6 +53,9 @@ func newGetManifestCmd(client helm.Interface, out io.Writer) *cobra.Command {
return errReleaseRequired
}
get.release = args[0]
if get.client == nil {
get.client = helm.NewClient(helm.HelmHost(helm.Config.ServAddr))
}
return get.run()
},
}
@ -61,7 +64,7 @@ func newGetManifestCmd(client helm.Interface, out io.Writer) *cobra.Command {
// getManifest implements 'helm get manifest'
func (g *getManifestCmd) run() error {
res, err := helm.GetReleaseContent(g.release)
res, err := g.client.ReleaseContent(g.release)
if err != nil {
return prettyError(err)
}

@ -51,6 +51,9 @@ func newGetValuesCmd(client helm.Interface, out io.Writer) *cobra.Command {
return errReleaseRequired
}
get.release = args[0]
if get.client == nil {
get.client = helm.NewClient(helm.HelmHost(helm.Config.ServAddr))
}
return get.run()
},
}

Loading…
Cancel
Save