77 "text/tabwriter"
88 "time"
99
10- "github.com/deislabs/duffle/pkg/claim"
11-
1210 "github.com/docker/app/internal/store"
1311 "github.com/docker/cli/cli"
1412 "github.com/docker/cli/cli/command"
@@ -24,14 +22,16 @@ type listOptions struct {
2422var (
2523 listColumns = []struct {
2624 header string
27- value func (c * claim. Claim ) string
25+ value func (i * store. Installation ) string
2826 }{
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+ }
3535)
3636
3737func listCmd (dockerCli command.Cli ) * cobra.Command {
@@ -70,12 +70,12 @@ func runList(dockerCli command.Cli, opts listOptions) error {
7070 w := tabwriter .NewWriter (dockerCli .Out (), 0 , 0 , 1 , ' ' , 0 )
7171 printHeaders (w )
7272
73- for _ , c := range installations {
74- installation , err := installationStore .Read (c )
73+ for _ , name := range installations {
74+ installation , err := installationStore .Read (name )
7575 if err != nil {
7676 return err
7777 }
78- printValues (w , & installation )
78+ printValues (w , installation )
7979 }
8080 return w .Flush ()
8181}
@@ -88,7 +88,7 @@ func printHeaders(w io.Writer) {
8888 fmt .Fprintln (w , strings .Join (headers , "\t " ))
8989}
9090
91- func printValues (w io.Writer , installation * claim. Claim ) {
91+ func printValues (w io.Writer , installation * store. Installation ) {
9292 var values []string
9393 for _ , column := range listColumns {
9494 values = append (values , column .value (installation ))
0 commit comments