-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: add options when using volume list #1028
Conversation
@rudyfly code conflict, please rebase your code, thanks a lot. |
733691a
to
7d96f9b
Compare
volume/types/volume.go
Outdated
@@ -191,6 +191,11 @@ func (v *Volume) Key() string { | |||
return v.Name | |||
} | |||
|
|||
//CreateTime returns the volume's create time. | |||
func (v *Volume) CreateTime() string { | |||
return v.CreationTimestamp.Format("2006-1-2 15:04:05") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that in the definition we have:
// CreationTimestamp is a timestamp representing the server time when this object was
// created. It is not guaranteed to be set in happens-before order across separate operations.
// Clients may not set this value. It is represented in RFC3339 form and is in UTC.
CreationTimestamp *time.Time `json:"CreationTimestamp,omitempty"`
It seems to be a pointer, so I am wondering if we need to detect it is non-nil ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
Codecov Report
@@ Coverage Diff @@
## master #1028 +/- ##
=========================================
Coverage ? 15.15%
=========================================
Files ? 135
Lines ? 8499
Branches ? 0
=========================================
Hits ? 1288
Misses ? 7110
Partials ? 101
Continue to review full report at Codecov.
|
Add options when using volume list, add volume driver into default volume list information. Add list volumes function in volume core module. Signed-off-by: Rudy Zhang <rudyflyzhang@gmail.com>
|
||
for _, v := range volumeList.Volumes { | ||
display.AddRow([]string{v.Name}) | ||
displayHead := []string{"DRIVER", "VOLUME NAME"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you help to change VOLUME NAME
into VOLUME_NAME
to avoid others to think that NAME
is another column? @rudyfly
LGTM |
Ⅰ. Describe what this PR did
Add options when using volume list, add volume driver into default
volume list information. Add list volumes function in volume core module.
Ⅱ. Does this pull request fix one issue?
fixes #921
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
listing volume format is "DRIVER VOLUME NAME", you can add some options, such as size and mountpoint, list volume with options like this:
Ⅴ. Special notes for reviews
Signed-off-by: Rudy Zhang rudyflyzhang@gmail.com