Remove the ShowDescription flag

Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
pull/13445/head
Lalatendu Mohanty 11 months ago
parent dd35343988
commit 926de91559

@ -58,7 +58,7 @@ func newGetAllCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
}
return tpl(template, data, out)
}
return output.Table.Write(out, &statusPrinter{res, true, false, false, true, false})
return output.Table.Write(out, &statusPrinter{res, true, false, true, false})
},
}

@ -158,7 +158,7 @@ func newInstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
return errors.Wrap(err, "INSTALLATION FAILED")
}
return outfmt.Write(out, &statusPrinter{rel, settings.Debug, false, false, false, client.HideNotes})
return outfmt.Write(out, &statusPrinter{rel, settings.Debug, false, false, client.HideNotes})
},
}

@ -72,7 +72,7 @@ func newReleaseTestCmd(cfg *action.Configuration, out io.Writer) *cobra.Command
return runErr
}
if err := outfmt.Write(out, &statusPrinter{rel, settings.Debug, false, false, false, client.HideNotes}); err != nil {
if err := outfmt.Write(out, &statusPrinter{rel, settings.Debug, false, false, client.HideNotes}); err != nil {
return err
}

@ -80,7 +80,7 @@ func newStatusCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
// strip chart metadata from the output
rel.Chart = nil
return outfmt.Write(out, &statusPrinter{rel, false, client.ShowDescription, client.ShowResources, false, false})
return outfmt.Write(out, &statusPrinter{rel, false, client.ShowResources, false, false})
},
}
@ -100,7 +100,6 @@ func newStatusCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
}
bindOutputFlag(cmd, &outfmt)
f.BoolVar(&client.ShowDescription, "show-desc", false, "if set, display the description message of the named release")
f.BoolVar(&client.ShowResources, "show-resources", false, "if set, display the resources of the named release")
@ -108,12 +107,11 @@ func newStatusCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
}
type statusPrinter struct {
release *release.Release
debug bool
showDescription bool
showResources bool
showMetadata bool
hideNotes bool
release *release.Release
debug bool
showResources bool
showMetadata bool
hideNotes bool
}
func (s statusPrinter) WriteJSON(out io.Writer) error {
@ -140,9 +138,6 @@ func (s statusPrinter) WriteTable(out io.Writer) error {
_, _ = fmt.Fprintf(out, "VERSION: %s\n", s.release.Chart.Metadata.Version)
_, _ = fmt.Fprintf(out, "APP_VERSION: %s\n", s.release.Chart.Metadata.AppVersion)
}
if s.showDescription {
_, _ = fmt.Fprintf(out, "DESCRIPTION: %s\n", s.release.Info.Description)
}
if s.showResources && s.release.Info.Resources != nil && len(s.release.Info.Resources) > 0 {
buf := new(bytes.Buffer)

@ -44,14 +44,6 @@ func TestStatusCmd(t *testing.T) {
rels: releasesMockWithStatus(&release.Info{
Status: release.StatusDeployed,
}),
}, {
name: "get status of a deployed release, with desc",
cmd: "status --show-desc flummoxed-chickadee",
golden: "output/status-with-desc.txt",
rels: releasesMockWithStatus(&release.Info{
Status: release.StatusDeployed,
Description: "Mock description",
}),
}, {
name: "get status of a deployed release with notes",
cmd: "status flummoxed-chickadee",

@ -1,7 +0,0 @@
NAME: flummoxed-chickadee
LAST DEPLOYED: Sat Jan 16 00:00:00 2016
NAMESPACE: default
STATUS: deployed
REVISION: 0
DESCRIPTION: Mock description
TEST SUITE: None

@ -160,7 +160,7 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
if err != nil {
return err
}
return outfmt.Write(out, &statusPrinter{rel, settings.Debug, false, false, false, instClient.HideNotes})
return outfmt.Write(out, &statusPrinter{rel, settings.Debug, false, false, instClient.HideNotes})
} else if err != nil {
return err
}
@ -247,7 +247,7 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
fmt.Fprintf(out, "Release %q has been upgraded. Happy Helming!\n", args[0])
}
return outfmt.Write(out, &statusPrinter{rel, settings.Debug, false, false, false, client.HideNotes})
return outfmt.Write(out, &statusPrinter{rel, settings.Debug, false, false, client.HideNotes})
},
}

@ -32,11 +32,6 @@ type Status struct {
Version int
// If true, display description to output format,
// only affect print type table.
// TODO Helm 4: Remove this flag and output the description by default.
ShowDescription bool
// ShowResources sets if the resources should be retrieved with the status.
// TODO Helm 4: Remove this flag and output the resources by default.
ShowResources bool

Loading…
Cancel
Save