Skip to content
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

Fix Volume inspect always yields null Options #8253

Merged

Conversation

YanzhaoLi
Copy link
Member

@YanzhaoLi YanzhaoLi commented Sep 4, 2018

When doing docker volume inspect, the Options field of the result is
always null.
The VolumeInspect() function fetches volume info and constructs
the Volume struct. But when constructing the struct, it doesn't assign
corresponding values into the Options fields of Volume struct.
The fix fills this field by modifying the NewVolumeModel() function.

The VolumeCreate() function also returns a Volume struct which
leaves Options field empty. But I find no usage of its detail info. Thus,
the fix makes no changes to this function.

Fix #7325
[specific ci=1-20-Docker-Volume-Inspect]

@YanzhaoLi YanzhaoLi requested review from zjs, wjun and hickeng September 4, 2018 06:38
@YanzhaoLi YanzhaoLi requested a review from a team as a code owner September 4, 2018 06:38
Copy link
Contributor

@wjun wjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks worth adding a unit test into volume_test.go, and a scenario test step into Group1-Docker-Commands related to volume inspect?

@hickeng
Copy link
Member

hickeng commented Sep 14, 2018

Concur with @wjun for the Group1 volume inspect test.

@zjs zjs added this to the Sprint 36 milestone Oct 26, 2018
when doing docker volume inspect, the Options filed of the result is
always null. The VolumeInspect() function fetches volume info. But when
 constructing the Volume using for docker, it doesn't assign
correponding values into the Options fields. Now the fix fills this
field by changing the NewVolumeModel fuction.

The VolumeCreate() function also returns a Volume struct which
unfills Options field. But I find no usage of its detail info. Thus, the
fix make no changes to this function.
@YanzhaoLi YanzhaoLi force-pushed the topic/fix-volumeinspect-yields-null-options branch from 4133bc2 to 45e0e3e Compare November 22, 2018 11:38
@YanzhaoLi
Copy link
Member Author

@wjun @hickeng Thanks for the review. I've added a test case into docker-volume-inpsect. In addition, I think there's no need to add a unit test for this pr, because its dependent function extractDockerMetadata has already being tested by volume_test.go

@YanzhaoLi YanzhaoLi requested review from alanrenouf and renmaosheng and removed request for alanrenouf November 23, 2018 03:47
@YanzhaoLi YanzhaoLi merged commit 2a7e167 into vmware:master Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

volume inspect always yields null options
6 participants