7
7
"text/tabwriter"
8
8
"time"
9
9
10
- "github.com/deislabs/duffle/pkg/claim"
11
-
12
10
"github.com/docker/app/internal/store"
13
11
"github.com/docker/cli/cli"
14
12
"github.com/docker/cli/cli/command"
@@ -24,14 +22,16 @@ type listOptions struct {
24
22
var (
25
23
listColumns = []struct {
26
24
header string
27
- value func (c * claim. Claim ) string
25
+ value func (i * store. Installation ) string
28
26
}{
29
- {"INSTALLATION" , func (c * claim.Claim ) string { return c .Name }},
30
- {"APPLICATION" , func (c * claim.Claim ) string { return fmt .Sprintf ("%s (%s)" , c .Bundle .Name , c .Bundle .Version ) }},
31
- {"LAST ACTION" , func (c * claim.Claim ) string { return c .Result .Action }},
32
- {"RESULT" , func (c * claim.Claim ) string { return c .Result .Status }},
33
- {"CREATED" , func (c * claim.Claim ) string { return units .HumanDuration (time .Since (c .Created )) }},
34
- {"MODIFIED" , func (c * claim.Claim ) string { return units .HumanDuration (time .Since (c .Modified )) }}}
27
+ {"INSTALLATION" , func (i * store.Installation ) string { return i .Name }},
28
+ {"APPLICATION" , func (i * store.Installation ) string { return fmt .Sprintf ("%s (%s)" , i .Bundle .Name , i .Bundle .Version ) }},
29
+ {"LAST ACTION" , func (i * store.Installation ) string { return i .Result .Action }},
30
+ {"RESULT" , func (i * store.Installation ) string { return i .Result .Status }},
31
+ {"CREATED" , func (i * store.Installation ) string { return units .HumanDuration (time .Since (i .Created )) }},
32
+ {"MODIFIED" , func (i * store.Installation ) string { return units .HumanDuration (time .Since (i .Modified )) }},
33
+ {"REFERENCE" , func (i * store.Installation ) string { return i .Reference }},
34
+ }
35
35
)
36
36
37
37
func listCmd (dockerCli command.Cli ) * cobra.Command {
@@ -70,12 +70,12 @@ func runList(dockerCli command.Cli, opts listOptions) error {
70
70
w := tabwriter .NewWriter (dockerCli .Out (), 0 , 0 , 1 , ' ' , 0 )
71
71
printHeaders (w )
72
72
73
- for _ , c := range installations {
74
- installation , err := installationStore .Read (c )
73
+ for _ , name := range installations {
74
+ installation , err := installationStore .Read (name )
75
75
if err != nil {
76
76
return err
77
77
}
78
- printValues (w , & installation )
78
+ printValues (w , installation )
79
79
}
80
80
return w .Flush ()
81
81
}
@@ -88,7 +88,7 @@ func printHeaders(w io.Writer) {
88
88
fmt .Fprintln (w , strings .Join (headers , "\t " ))
89
89
}
90
90
91
- func printValues (w io.Writer , installation * claim. Claim ) {
91
+ func printValues (w io.Writer , installation * store. Installation ) {
92
92
var values []string
93
93
for _ , column := range listColumns {
94
94
values = append (values , column .value (installation ))
0 commit comments