Commit 586dc1db authored by Morten Torkildsen's avatar Morten Torkildsen

fix(helm): Use line breaks consistently in status output

The output from helm status does not have consistent use of line breaks.
For some resources there is a line break after the kind header, for
others there is not. This is caused by how the printer handles column
headers. This removes a line break for all but the first resource listed.
Signed-off-by: 's avatarMorten Torkildsen <mortent@google.com>
parent eff90992
......@@ -213,8 +213,13 @@ func (c *Client) Get(namespace string, reader io.Reader) (string, error) {
// track of tab widths.
buf := new(bytes.Buffer)
p, _ := get.NewHumanPrintFlags().ToPrinter("")
index := 0
for t, ot := range objs {
if _, err = buf.WriteString("==> " + t + "\n"); err != nil {
kindHeader := fmt.Sprintf("==> %s", t)
if index == 0 {
kindHeader = kindHeader + "\n"
}
if _, err = buf.WriteString(kindHeader); err != nil {
return "", err
}
for _, o := range ot {
......@@ -226,6 +231,7 @@ func (c *Client) Get(namespace string, reader io.Reader) (string, error) {
if _, err := buf.WriteString("\n"); err != nil {
return "", err
}
index += 1
}
if len(missing) > 0 {
buf.WriteString(MissingGetHeader)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment