Skip to content

Commit eadba19

Browse files
committed
feat(release): add ptypes filter
1 parent e69771f commit eadba19

7 files changed

Lines changed: 13 additions & 10 deletions

File tree

cmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ type Commander interface {
9898
RegistryList(string, int) error
9999
RegistrySet(string, []string) error
100100
RegistryUnset(string, []string) error
101-
ReleasesList(string, int) error
101+
ReleasesList(string, string, int) error
102102
ReleasesInfo(string, int) error
103103
ReleasesDeploy(string, []string, bool, string) error
104104
ReleasesRollback(string, []string, int) error

cmd/releases.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
// ReleasesList lists an app's releases.
12-
func (d *DryccCmd) ReleasesList(appID string, results int) error {
12+
func (d *DryccCmd) ReleasesList(appID, ptypes string, results int) error {
1313
s, appID, err := load(d.ConfigFile, appID)
1414

1515
if err != nil {
@@ -20,7 +20,7 @@ func (d *DryccCmd) ReleasesList(appID string, results int) error {
2020
results = s.Limit
2121
}
2222

23-
releases, count, err := releases.List(s.Client, appID, results)
23+
releases, count, err := releases.List(s.Client, appID, ptypes, results)
2424
if d.checkAPICompatibility(s.Client, err) != nil {
2525
return err
2626
}

cmd/releases_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestReleasesList(t *testing.T) {
5757
}`)
5858
})
5959

60-
err = cmdr.ReleasesList("numenor", -1)
60+
err = cmdr.ReleasesList("numenor", "", -1)
6161
assert.NoError(t, err)
6262
assert.Equal(t, b.String(), `OWNER STATE VERSION CREATED SUMMARY
6363
nazgul succeed v2 2016-08-22T17:40:16Z khamul added ANGMAR
@@ -98,7 +98,7 @@ func TestReleasesListLimit(t *testing.T) {
9898
}`)
9999
})
100100

101-
err = cmdr.ReleasesList("numenor", 1)
101+
err = cmdr.ReleasesList("numenor", "", 1)
102102
assert.NoError(t, err)
103103
assert.Equal(t, b.String(), `OWNER STATE VERSION CREATED SUMMARY
104104
nazgul succeed v2 2016-08-22T17:40:16Z khamul added ANGMAR

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.22.0
55
require (
66
github.com/containerd/console v1.0.4
77
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
8-
github.com/drycc/controller-sdk-go v0.0.0-20241014021330-60aa12d26766
8+
github.com/drycc/controller-sdk-go v0.0.0-20241021053012-e5fbff128198
99
github.com/drycc/pkg v0.0.0-20240225112316-78fc9239f51f
1010
github.com/minio/selfupdate v0.6.0
1111
github.com/olekukonko/tablewriter v0.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
88
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
99
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
1010
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
11-
github.com/drycc/controller-sdk-go v0.0.0-20241014021330-60aa12d26766 h1:6Wda7jbd3htqcbd8j6JgZTr84YS2fQe5g5NGHTCb2Ag=
12-
github.com/drycc/controller-sdk-go v0.0.0-20241014021330-60aa12d26766/go.mod h1:XOfsqEM0rZ9UOT0jtx2czBntSq9Nko80yGMVGyREzDg=
11+
github.com/drycc/controller-sdk-go v0.0.0-20241021053012-e5fbff128198 h1:dYM7kZEsbr9/z+HDfBXkI2ZCVwCZca99uoT949BRC7M=
12+
github.com/drycc/controller-sdk-go v0.0.0-20241021053012-e5fbff128198/go.mod h1:XOfsqEM0rZ9UOT0jtx2czBntSq9Nko80yGMVGyREzDg=
1313
github.com/drycc/pkg v0.0.0-20240225112316-78fc9239f51f h1:kgjvUQJeAszDoU1Vo4vTTE92KI8Av3JPb6Qn890niXg=
1414
github.com/drycc/pkg v0.0.0-20240225112316-78fc9239f51f/go.mod h1:n+QxGif6ha9CEoxVnlipxb9IdmerybcUSzTEDFkvjiA=
1515
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=

parser/releases.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Usage: drycc releases:list [options]
5454
Options:
5555
-a --app=<app>
5656
the uniquely identifiable name for the application.
57+
--ptypes=<ptypes>
58+
the processes name as defined in your Procfile, comma separated.
5759
-l --limit=<num>
5860
the maximum number of results to display, defaults to config setting
5961
`
@@ -69,8 +71,9 @@ Options:
6971
}
7072

7173
app := safeGetString(args, "--app")
74+
ptypes := safeGetString(args, "--ptypes")
7275

73-
return cmdr.ReleasesList(app, results)
76+
return cmdr.ReleasesList(app, ptypes, results)
7477
}
7578

7679
func releasesInfo(argv []string, cmdr cmd.Commander) error {

parser/releases_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
// Create fake implementations of each method that return the argument
1313
// we expect to have called the function (as an error to satisfy the interface).
1414

15-
func (d FakeDryccCmd) ReleasesList(string, int) error {
15+
func (d FakeDryccCmd) ReleasesList(string, string, int) error {
1616
return errors.New("releases:list")
1717
}
1818

0 commit comments

Comments
 (0)