Skip to content

Commit

Permalink
Add CreatedAt to Volume
Browse files Browse the repository at this point in the history
Closes fsouza#743.
  • Loading branch information
fsouza committed Aug 8, 2018
1 parent b9ee4de commit 8683256
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"encoding/json"
"errors"
"net/http"
"time"
)

var (
Expand All @@ -28,6 +29,7 @@ type Volume struct {
Mountpoint string `json:"Mountpoint,omitempty" yaml:"Mountpoint,omitempty" toml:"Mountpoint,omitempty"`
Labels map[string]string `json:"Labels,omitempty" yaml:"Labels,omitempty" toml:"Labels,omitempty"`
Options map[string]string `json:"Options,omitempty" yaml:"Options,omitempty" toml:"Options,omitempty"`
CreatedAt time.Time `json:"CreatedAt,omitempty" yaml:"CreatedAt,omitempty" toml:"CreatedAt,omitempty"`
}

// ListVolumesOptions specify parameters to the ListVolumes function.
Expand Down
6 changes: 4 additions & 2 deletions volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ func TestListVolumes(t *testing.T) {
{
"Name": "tardis",
"Driver": "local",
"Mountpoint": "/var/lib/docker/volumes/tardis"
"Mountpoint": "/var/lib/docker/volumes/tardis",
"CreatedAt": "2017-07-19T12:00:26Z"
},
{
"Name": "foo",
"Driver": "bar",
"Mountpoint": "/var/lib/docker/volumes/bar"
"Mountpoint": "/var/lib/docker/volumes/bar",
"CreatedAt": "2017-07-19T12:01:26Z"
}
]`
body := `{ "Volumes": ` + volumesData + ` }`
Expand Down

0 comments on commit 8683256

Please sign in to comment.