Commit 765da276 authored by Matt Butcher's avatar Matt Butcher Committed by GitHub

Merge pull request #1389 from technosophos/fix/1387-show-failed

fix(helm): show failed releases by default
parents d7e56133 51240d52
......@@ -33,8 +33,9 @@ import (
var listHelp = `
This command lists all of the releases.
By default, it lists only releases that are deployed. Flags like '--delete' and
'--all' will alter this behavior. Such flags can be combined: '--deleted --failed'.
By default, it lists only releases that are deployed or failed. Flags like
'--delete' and '--all' will alter this behavior. Such flags can be combined:
'--deleted --failed'.
By default, items are sorted alphabetically. Use the '-d' flag to sort by
release date.
......@@ -186,7 +187,7 @@ func (l *listCmd) statusCodes() []release.Status_Code {
// Default case.
if len(status) == 0 {
status = append(status, release.Status_DEPLOYED)
status = append(status, release.Status_DEPLOYED, release.Status_FAILED)
}
return status
}
......
......@@ -47,6 +47,15 @@ func TestListCmd(t *testing.T) {
},
expected: "NAME \tREVISION\tUPDATED \tSTATUS \tCHART \natlas\t1 \t(.*)\tDEPLOYED\tfoo-0.1.0-beta.1\n",
},
{
name: "list, one deployed, one failed",
args: []string{"-q"},
resp: []*release.Release{
releaseMock(&releaseOptions{name: "thomas-guide", statusCode: release.Status_FAILED}),
releaseMock(&releaseOptions{name: "atlas-guide", statusCode: release.Status_DEPLOYED}),
},
expected: "thomas-guide\natlas-guide",
},
{
name: "with a release, multiple flags",
args: []string{"--deleted", "--deployed", "--failed", "-q"},
......@@ -83,7 +92,7 @@ func TestListCmd(t *testing.T) {
}
re := regexp.MustCompile(tt.expected)
if !re.Match(buf.Bytes()) {
t.Errorf("%q. expected %q, got %q", tt.name, tt.expected, buf.String())
t.Errorf("%q. expected\n%q\ngot\n%q", tt.name, tt.expected, buf.String())
}
buf.Reset()
}
......
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