Skip to content

Commit de591be

Browse files
committed
feat(release): add query release version
1 parent 081662b commit de591be

27 files changed

Lines changed: 107 additions & 61 deletions

cmd/cmd.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type Commander interface {
4242
CertInfo(string, string) error
4343
CertAttach(string, string, string) error
4444
CertDetach(string, string, string) error
45-
ConfigList(string, string) error
45+
ConfigList(string, string, int) error
4646
ConfigSet(string, string, []string, string) error
4747
ConfigUnset(string, string, []string, string) error
4848
ConfigPull(string, string, string, bool, bool) error
@@ -65,7 +65,7 @@ type Commander interface {
6565
RoutesRemove(string, string) error
6666
GitRemote(string, string, bool) error
6767
GitRemove(string) error
68-
HealthchecksList(string, string) error
68+
HealthchecksList(string, string, int) error
6969
HealthchecksSet(string, string, string, *api.Healthcheck) error
7070
HealthchecksUnset(string, string, []string) error
7171
KeysList(int) error
@@ -74,12 +74,12 @@ type Commander interface {
7474
LabelsList(string) error
7575
LabelsSet(string, []string) error
7676
LabelsUnset(string, []string) error
77-
LimitsList(string) error
77+
LimitsList(string, int) error
7878
LimitsSet(string, []string) error
7979
LimitsUnset(string, []string) error
8080
LimitsSpecs(string, int) error
8181
LimitsPlans(string, int, int, int) error
82-
TimeoutsList(string) error
82+
TimeoutsList(string, int) error
8383
TimeoutsSet(string, []string) error
8484
TimeoutsUnset(string, []string) error
8585
PermList(string, int) error
@@ -95,7 +95,7 @@ type Commander interface {
9595
PtsDescribe(string, string) error
9696
PtsScale(string, []string) error
9797
PtsRestart(string, []string, string) error
98-
RegistryList(string) error
98+
RegistryList(string, int) error
9999
RegistrySet(string, []string) error
100100
RegistryUnset(string, []string) error
101101
ReleasesList(string, int) error
@@ -106,7 +106,7 @@ type Commander interface {
106106
RoutingEnable(string) error
107107
RoutingDisable(string) error
108108
ShortcutsList() error
109-
TagsList(string, string) error
109+
TagsList(string, string, int) error
110110
TagsSet(string, string, []string) error
111111
TagsUnset(string, string, []string) error
112112
TLSInfo(string) error

cmd/config.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ import (
1717
)
1818

1919
// ConfigList lists an app's config.
20-
func (d *DryccCmd) ConfigList(appID string, ptype string) error {
20+
func (d *DryccCmd) ConfigList(appID string, ptype string, version int) error {
2121
s, appID, err := load(d.ConfigFile, appID)
2222
if err != nil {
2323
return err
2424
}
25-
config, err := config.List(s.Client, appID)
25+
config, err := config.List(s.Client, appID, version)
2626
if d.checkAPICompatibility(s.Client, err) != nil {
2727
return err
2828
}
@@ -99,7 +99,7 @@ to set up healthchecks. This functionality has been deprecated. In the future, p
9999
d.Print("done\n\n")
100100
}
101101

102-
return d.ConfigList(appID, ptype)
102+
return d.ConfigList(appID, ptype, -1)
103103
}
104104

105105
// ConfigUnset removes a config variable from an app.
@@ -148,7 +148,7 @@ func (d *DryccCmd) ConfigUnset(appID string, ptype string, configVars []string,
148148
d.Print("done\n\n")
149149
}
150150

151-
return d.ConfigList(appID, ptype)
151+
return d.ConfigList(appID, ptype, -1)
152152
}
153153

154154
// ConfigPull pulls an app's config to a file.
@@ -159,7 +159,7 @@ func (d *DryccCmd) ConfigPull(appID, ptype, fileName string, interactive bool, o
159159
return err
160160
}
161161

162-
configVars, err := config.List(s.Client, appID)
162+
configVars, err := config.List(s.Client, appID, -1)
163163
if d.checkAPICompatibility(s.Client, err) != nil {
164164
return err
165165
}

cmd/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func TestConfigList(t *testing.T) {
123123
var b bytes.Buffer
124124
cmdr := DryccCmd{WOut: &b, ConfigFile: cf}
125125

126-
err = cmdr.ConfigList("foo", "")
126+
err = cmdr.ConfigList("foo", "", -1)
127127
assert.NoError(t, err)
128128

129129
assert.Equal(t, b.String(), `PTYPE NAME VALUE
@@ -135,7 +135,7 @@ web PORT 9000
135135
`, "output")
136136

137137
b.Reset()
138-
err = cmdr.ConfigList("foo", "web")
138+
err = cmdr.ConfigList("foo", "web", -1)
139139
assert.NoError(t, err)
140140
assert.Equal(t, b.String(), `PTYPE NAME VALUE
141141
N/A FLOAT 12.34

cmd/healthchecks.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ func getHealthchecksStrings(ptype string, healthchecks *api.Healthchecks) []stri
4545
}
4646

4747
// HealthchecksList lists an app's healthchecks.
48-
func (d *DryccCmd) HealthchecksList(appID, ptype string) error {
48+
func (d *DryccCmd) HealthchecksList(appID, ptype string, version int) error {
4949
s, appID, err := load(d.ConfigFile, appID)
5050
if err != nil {
5151
return err
5252
}
5353

54-
config, err := config.List(s.Client, appID)
54+
config, err := config.List(s.Client, appID, version)
5555

5656
if err != nil {
5757
return err
@@ -132,7 +132,7 @@ func (d *DryccCmd) HealthchecksSet(appID, healthcheckType, ptype string, probe *
132132

133133
d.Print("done\n\n")
134134

135-
return d.HealthchecksList(appID, ptype)
135+
return d.HealthchecksList(appID, ptype, -1)
136136
}
137137

138138
// HealthchecksUnset removes an app's healthchecks.
@@ -169,5 +169,5 @@ func (d *DryccCmd) HealthchecksUnset(appID, ptype string, healthchecks []string)
169169

170170
d.Print("done\n\n")
171171

172-
return d.HealthchecksList(appID, ptype)
172+
return d.HealthchecksList(appID, ptype, -1)
173173
}

cmd/healthchecks_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestHealthchecksList(t *testing.T) {
5252
}`)
5353
})
5454

55-
err = cmdr.HealthchecksList("foo", "web")
55+
err = cmdr.HealthchecksList("foo", "web", -1)
5656
assert.NoError(t, err)
5757

5858
assert.Equal(t, b.String(), `App: foo
@@ -92,7 +92,7 @@ func TestHealthchecksListNoHealthCheck(t *testing.T) {
9292
}`)
9393
})
9494

95-
err = cmdr.HealthchecksList("foo", "")
95+
err = cmdr.HealthchecksList("foo", "", -1)
9696
assert.NoError(t, err)
9797

9898
assert.Equal(t, b.String(), `No health checks configured.
@@ -153,7 +153,7 @@ func TestHealthchecksListAllHealthChecks(t *testing.T) {
153153
}`)
154154
})
155155

156-
err = cmdr.HealthchecksList("foo", "")
156+
err = cmdr.HealthchecksList("foo", "", -1)
157157
assert.NoError(t, err)
158158

159159
assert.Equal(t, b.String(), `App: foo

cmd/limits.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import (
1111
)
1212

1313
// LimitsList lists an app's limits.
14-
func (d *DryccCmd) LimitsList(appID string) error {
14+
func (d *DryccCmd) LimitsList(appID string, version int) error {
1515
s, appID, err := load(d.ConfigFile, appID)
1616

1717
if err != nil {
1818
return err
1919
}
2020

21-
config, err := config.List(s.Client, appID)
21+
config, err := config.List(s.Client, appID, version)
2222
if d.checkAPICompatibility(s.Client, err) != nil {
2323
return err
2424
}
@@ -85,7 +85,7 @@ func (d *DryccCmd) LimitsSet(appID string, limits []string) error {
8585

8686
d.Print("done\n\n")
8787

88-
return d.LimitsList(appID)
88+
return d.LimitsList(appID, -1)
8989
}
9090

9191
// LimitsUnset removes an app's limits.
@@ -118,7 +118,7 @@ func (d *DryccCmd) LimitsUnset(appID string, limits []string) error {
118118

119119
d.Print("done\n\n")
120120

121-
return d.LimitsList(appID)
121+
return d.LimitsList(appID, -1)
122122
}
123123

124124
// LimitsSpecs list limit spec

cmd/limits_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func TestLimitsList(t *testing.T) {
297297
var b bytes.Buffer
298298
cmdr := DryccCmd{WOut: &b, ConfigFile: cf}
299299

300-
err := cmdr.LimitsList("enterprise")
300+
err := cmdr.LimitsList("enterprise", -1)
301301
assert.NoError(t, err)
302302
assert.Equal(t, b.String(), `PTYPE PLAN VCPUS MEMORY FEATURES
303303
db std1.large.c1m1 1 1 GiB Unknown Integrated GPU shared * 1
@@ -321,7 +321,7 @@ worker std1.large.c1m1 1 1 GiB Unknown Integrated GPU shared *
321321
})
322322
b.Reset()
323323

324-
err = cmdr.LimitsList("franklin")
324+
err = cmdr.LimitsList("franklin", -1)
325325
assert.NoError(t, err)
326326
assert.Equal(t, b.String(), `No limits found in franklin app.
327327
`, "output")

cmd/registry.go

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

1111
// RegistryList lists an app's registry information.
12-
func (d *DryccCmd) RegistryList(appID string) error {
12+
func (d *DryccCmd) RegistryList(appID string, version int) error {
1313
s, appID, err := load(d.ConfigFile, appID)
1414

1515
if err != nil {
1616
return err
1717
}
1818

19-
config, err := config.List(s.Client, appID)
19+
config, err := config.List(s.Client, appID, version)
2020
if d.checkAPICompatibility(s.Client, err) != nil {
2121
return err
2222
}
@@ -63,7 +63,7 @@ func (d *DryccCmd) RegistrySet(appID string, item []string) error {
6363

6464
d.Print("done\n\n")
6565

66-
return d.RegistryList(appID)
66+
return d.RegistryList(appID, -1)
6767
}
6868

6969
// RegistryUnset removes an app's registry information.
@@ -97,7 +97,7 @@ func (d *DryccCmd) RegistryUnset(appID string, items []string) error {
9797

9898
d.Print("done\n\n")
9999

100-
return d.RegistryList(appID)
100+
return d.RegistryList(appID, -1)
101101
}
102102

103103
func parseInfos(items []string) (map[string]interface{}, error) {

cmd/registry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func TestRegistryList(t *testing.T) {
103103
var b bytes.Buffer
104104
cmdr := DryccCmd{WOut: &b, ConfigFile: cf}
105105

106-
err = cmdr.RegistryList("enterprise")
106+
err = cmdr.RegistryList("enterprise", -1)
107107
assert.NoError(t, err)
108108
assert.Equal(t, b.String(), `KEY VALUE
109109
password ncc1701

cmd/tags.go

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

1111
// TagsList lists an app's tags.
12-
func (d *DryccCmd) TagsList(appID, ptype string) error {
12+
func (d *DryccCmd) TagsList(appID, ptype string, version int) error {
1313
s, appID, err := load(d.ConfigFile, appID)
1414

1515
if err != nil {
1616
return err
1717
}
1818

19-
config, err := config.List(s.Client, appID)
19+
config, err := config.List(s.Client, appID, version)
2020
if d.checkAPICompatibility(s.Client, err) != nil {
2121
return err
2222
}
@@ -65,7 +65,7 @@ func (d *DryccCmd) TagsSet(appID, ptype string, tags []string) error {
6565

6666
d.Print("done\n\n")
6767

68-
return d.TagsList(appID, ptype)
68+
return d.TagsList(appID, ptype, -1)
6969
}
7070

7171
// TagsUnset removes an app's tags.
@@ -96,7 +96,7 @@ func (d *DryccCmd) TagsUnset(appID, ptype string, tags []string) error {
9696

9797
d.Print("done\n\n")
9898

99-
return d.TagsList(appID, ptype)
99+
return d.TagsList(appID, ptype, -1)
100100
}
101101

102102
func parseTags(tags []string) (map[string]interface{}, error) {

0 commit comments

Comments
 (0)