Example #1
0
File: get.go Project: gabrtv/helm
// getCmd is the command that implements 'helm get'
func getCmd(cmd *cobra.Command, args []string) error {
	if len(args) == 0 {
		return errReleaseRequired
	}

	res, err := helm.GetReleaseContent(args[0])
	if err != nil {
		return prettyError(err)
	}

	cfg, err := chartutil.CoalesceValues(res.Release.Chart, res.Release.Config, nil)
	if err != nil {
		return err
	}
	cfgStr, err := cfg.YAML()
	if err != nil {
		return err
	}

	fmt.Printf("CHART: %s-%s\n", res.Release.Chart.Metadata.Name, res.Release.Chart.Metadata.Version)
	fmt.Printf("RELEASED: %s\n", timeconv.Format(res.Release.Info.LastDeployed, time.ANSIC))
	fmt.Println("USER-SUPPLIED VALUES:")
	fmt.Println(res.Release.Config.Raw)
	fmt.Println("COMPUTED VALUES:")
	fmt.Println(cfgStr)
	fmt.Println("MANIFEST:")
	fmt.Println(res.Release.Manifest)
	return nil
}
Example #2
0
// getCmd is the command that implements 'helm get'
func (g *getCmd) run() error {
	res, err := g.client.ReleaseContent(g.release)
	if err != nil {
		return prettyError(err)
	}

	cfg, err := chartutil.CoalesceValues(res.Release.Chart, res.Release.Config, nil)
	if err != nil {
		return err
	}
	cfgStr, err := cfg.YAML()
	if err != nil {
		return err
	}

	fmt.Fprintf(g.out, "CHART: %s-%s\n", res.Release.Chart.Metadata.Name, res.Release.Chart.Metadata.Version)
	fmt.Fprintf(g.out, "RELEASED: %s\n", timeconv.Format(res.Release.Info.LastDeployed, time.ANSIC))
	fmt.Fprintln(g.out, "USER-SUPPLIED VALUES:")
	fmt.Fprintln(g.out, res.Release.Config.Raw)
	fmt.Fprintln(g.out, "COMPUTED VALUES:")
	fmt.Fprintln(g.out, cfgStr)
	fmt.Fprintln(g.out, "MANIFEST:")
	fmt.Fprintln(g.out, res.Release.Manifest)
	return nil
}
Example #3
0
File: get.go Project: runseb/helm
// getCmd is the command that implements 'helm get'
func (g *getCmd) run() error {
	res, err := g.client.ReleaseContent(g.release, helm.ContentReleaseVersion(g.version))
	if err != nil {
		return prettyError(err)
	}

	cfg, err := chartutil.CoalesceValues(res.Release.Chart, res.Release.Config)
	if err != nil {
		return err
	}
	cfgStr, err := cfg.YAML()
	if err != nil {
		return err
	}

	data := map[string]interface{}{
		"Release":        res.Release,
		"ComputedValues": cfgStr,
		"ReleaseDate":    timeconv.Format(res.Release.Info.LastDeployed, time.ANSIC),
	}
	return tpl(getTemplate, data, g.out)
}