Merge pull request #1364 from technosophos/fix/1135-output-consistency

fix(helm): make 'helm install' output more consistent
pull/1373/head
Matt Butcher 9 years ago committed by GitHub
commit 70a9e4aa6b

@ -143,7 +143,7 @@ func setupConnection(c *cobra.Command, args []string) error {
// Set up the gRPC config. // Set up the gRPC config.
if flagDebug { if flagDebug {
fmt.Printf("Server: %q\n", tillerHost) fmt.Printf("SERVER: %q\n", tillerHost)
} }
return nil return nil
} }

@ -36,7 +36,6 @@ import (
"k8s.io/helm/cmd/helm/helmpath" "k8s.io/helm/cmd/helm/helmpath"
"k8s.io/helm/pkg/helm" "k8s.io/helm/pkg/helm"
"k8s.io/helm/pkg/proto/hapi/release" "k8s.io/helm/pkg/proto/hapi/release"
"k8s.io/helm/pkg/timeconv"
) )
const installDesc = ` const installDesc = `
@ -143,7 +142,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command {
func (i *installCmd) run() error { func (i *installCmd) run() error {
if flagDebug { if flagDebug {
fmt.Fprintf(i.out, "Chart path: %s\n", i.chartPath) fmt.Fprintf(i.out, "CHART PATH: %s\n", i.chartPath)
} }
rawVals, err := i.vals() rawVals, err := i.vals()
@ -158,7 +157,7 @@ func (i *installCmd) run() error {
return err return err
} }
// Print the final name so the user knows what the final name of the release is. // Print the final name so the user knows what the final name of the release is.
fmt.Printf("Final name: %s\n", i.name) fmt.Printf("FINAL NAME: %s\n", i.name)
} }
res, err := i.client.InstallRelease( res, err := i.client.InstallRelease(
@ -226,12 +225,11 @@ func (i *installCmd) printRelease(rel *release.Release) {
// TODO: Switch to text/template like everything else. // TODO: Switch to text/template like everything else.
if flagDebug { if flagDebug {
fmt.Fprintf(i.out, "NAME: %s\n", rel.Name) fmt.Fprintf(i.out, "NAME: %s\n", rel.Name)
fmt.Fprintf(i.out, "NAMESPACE: %s\n", rel.Namespace) fmt.Fprintf(i.out, "TARGET NAMESPACE: %s\n", rel.Namespace)
fmt.Fprintf(i.out, "INFO: %s %s\n", timeconv.String(rel.Info.LastDeployed), rel.Info.Status)
fmt.Fprintf(i.out, "CHART: %s %s\n", rel.Chart.Metadata.Name, rel.Chart.Metadata.Version) fmt.Fprintf(i.out, "CHART: %s %s\n", rel.Chart.Metadata.Name, rel.Chart.Metadata.Version)
fmt.Fprintf(i.out, "MANIFEST: %s\n", rel.Manifest) fmt.Fprintf(i.out, "MANIFEST: %s\n", rel.Manifest)
} else { } else {
fmt.Fprintln(i.out, rel.Name) fmt.Fprintf(i.out, "NAME: %s\n", rel.Name)
} }
} }

@ -79,18 +79,18 @@ func (s *statusCmd) run() error {
// install / upgrade // install / upgrade
func PrintStatus(out io.Writer, res *services.GetReleaseStatusResponse) { func PrintStatus(out io.Writer, res *services.GetReleaseStatusResponse) {
if res.Info.LastDeployed != nil { if res.Info.LastDeployed != nil {
fmt.Fprintf(out, "Last Deployed: %s\n", timeconv.String(res.Info.LastDeployed)) fmt.Fprintf(out, "LAST DEPLOYED: %s\n", timeconv.String(res.Info.LastDeployed))
} }
fmt.Fprintf(out, "Namespace: %s\n", res.Namespace) fmt.Fprintf(out, "NAMESPACE: %s\n", res.Namespace)
fmt.Fprintf(out, "Status: %s\n", res.Info.Status.Code) fmt.Fprintf(out, "STATUS: %s\n", res.Info.Status.Code)
if res.Info.Status.Details != nil { if res.Info.Status.Details != nil {
fmt.Fprintf(out, "Details: %s\n", res.Info.Status.Details) fmt.Fprintf(out, "Details: %s\n", res.Info.Status.Details)
} }
fmt.Fprintf(out, "\n") fmt.Fprintf(out, "\n")
if len(res.Info.Status.Resources) > 0 { if len(res.Info.Status.Resources) > 0 {
fmt.Fprintf(out, "Resources:\n%s\n", res.Info.Status.Resources) fmt.Fprintf(out, "RESOURCES:\n%s\n", res.Info.Status.Resources)
} }
if len(res.Info.Status.Notes) > 0 { if len(res.Info.Status.Notes) > 0 {
fmt.Fprintf(out, "Notes:\n%s\n", res.Info.Status.Notes) fmt.Fprintf(out, "NOTES:\n%s\n", res.Info.Status.Notes)
} }
} }

Loading…
Cancel
Save