code: func RenderReleaseMock(r *release.Release, asUpgrade bool) error {
  	if r == nil || r.Chart == nil || r.Chart.Metadata == nil {
  		return errors.New("a release with a chart with metadata must be provided to render the manifests")
  	}
  
  	renderOpts := renderutil.Options{
  		ReleaseOptions: chartutil.ReleaseOptions{
  			Name:      r.Name,
  			Namespace: r.Namespace,
  			Time:      r.Info.LastDeployed,
  			Revision:  int(r.Version),
  			IsUpgrade: asUpgrade,
  			IsInstall: !asUpgrade,
  		},
  	}
  	rendered, err := renderutil.Render(r.Chart, r.Config, renderOpts)
  	if err != nil {
  		return err
  	}
  
  	b := bytes.NewBuffer(nil)
  	for _, m := range manifest.SplitManifests(rendered) {
  		// Remove empty manifests
  		if len(strings.TrimSpace(m.Content)) == 0 {
  			continue
  		}
  		b.WriteString("\n---\n# Source: " + m.Name + "\n")
  		b.WriteString(m.Content)
  	}
  	r.Manifest = b.String()
  	return nil
  }
docs: // RenderReleaseMock will take a release (usually produced by helm.ReleaseMock)
  // and will render the Manifest inside using the local mechanism (no tiller).
  // (Compare to renderResources in pkg/tiller)