Skip to content

Commit 97428ad

Browse files
author
lijianguo
committed
chore(workflow-cli):upgrade require controller-sdk-go and pretty volume Printing
1 parent 0197252 commit 97428ad

5 files changed

Lines changed: 9 additions & 8 deletions

File tree

cmd/apps.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ func (d *DryccCmd) AppRun(appID, command string, volumeVars []string) error {
200200

201201
d.Printf("Running '%s'...\n", command)
202202
volumeMap, err := parseMount(volumeVars)
203-
//volumeObj := map[string]interface{}{
204-
// "volumes": volumeMap,
205-
//}
203+
if d.checkAPICompatibility(s.Client, err) != nil {
204+
return err
205+
}
206206

207207
out, err := apps.Run(s.Client, appID, command, volumeMap)
208208
if d.checkAPICompatibility(s.Client, err) != nil {

cmd/volumes.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,13 @@ func (d *DryccCmd) VolumesList(appID string, results int) error {
3636

3737
// printVolumes format volume data
3838
func printVolumes(d *DryccCmd, appID string, volumes api.Volumes, wOut io.Writer) {
39-
//volumes := ps.ByType(input)
4039

4140
fmt.Fprintf(wOut, "=== %s volumes\n", appID)
4241

4342
for _, volume := range volumes {
44-
fmt.Fprintf(wOut, "--- %s %s\n", volume.Name, volume.Size)
43+
fmt.Fprintf(wOut, "--- %s\t%s\n", volume.Name, volume.Size)
4544
for k, v := range volume.Path {
46-
fmt.Println(k, v)
45+
fmt.Fprintf(wOut, "%s\t\t%s\n", k, v)
4746
}
4847
}
4948
}

cmd/volumes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestVolumesList(t *testing.T) {
4646
assert.NoErr(t, err)
4747

4848
assert.Equal(t, b.String(), `=== example-go volumes
49-
--- myvolume 500M
49+
--- myvolume 500M
5050
`, "output")
5151
}
5252

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.13
55
require (
66
github.com/arschles/assert v1.0.1-0.20191213221312-71f210f9375a
77
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
8-
github.com/drycc/controller-sdk-go v0.0.0-20200813035713-e73ce53533e7
8+
github.com/drycc/controller-sdk-go v0.0.0-20200901021526-471d3aa9862b
99
github.com/drycc/pkg v0.0.0-20200811173146-1f2b2781a852
1010
github.com/olekukonko/tablewriter v0.0.4
1111
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ github.com/drycc/controller-sdk-go v0.0.0-20200804054414-9d56a7f85205 h1:6agdZ9/
3434
github.com/drycc/controller-sdk-go v0.0.0-20200804054414-9d56a7f85205/go.mod h1:mF8/kZ/E4oDHCtfUVS790Frm8oVzZkoCGCKYT2eWQro=
3535
github.com/drycc/controller-sdk-go v0.0.0-20200813035713-e73ce53533e7 h1:8tlFlmR2XE6IULo2gG7YcOycaFCSMOcnSMP5M/rhBLQ=
3636
github.com/drycc/controller-sdk-go v0.0.0-20200813035713-e73ce53533e7/go.mod h1:mF8/kZ/E4oDHCtfUVS790Frm8oVzZkoCGCKYT2eWQro=
37+
github.com/drycc/controller-sdk-go v0.0.0-20200901021526-471d3aa9862b h1:scZpGVSBX32HcCQcqwGmH1TKuy1xEczyF0fDH0XP1xA=
38+
github.com/drycc/controller-sdk-go v0.0.0-20200901021526-471d3aa9862b/go.mod h1:mF8/kZ/E4oDHCtfUVS790Frm8oVzZkoCGCKYT2eWQro=
3739
github.com/drycc/pkg v0.0.0-20190129033019-bcdffff0fcb3 h1:QRAbL97/hJecXQzaSONMCiwt1JjBKAAMKK0qJW5sgIM=
3840
github.com/drycc/pkg v0.0.0-20190129033019-bcdffff0fcb3/go.mod h1:zNgTT6kuGZOKMIdSrjskIw5fctdbbszqiTPEt3ffxHw=
3941
github.com/drycc/pkg v0.0.0-20200811173146-1f2b2781a852 h1:OsWH7jrv2i32rkvHFuj3yVpGMR+A6heRge9tm01XR/U=

0 commit comments

Comments
 (0)