Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
cmd/juju/storage: add binding/life to details #7047
Conversation
axw
added some commits
Feb 27, 2017
| @@ -544,21 +554,42 @@ type VolumeDetails struct { | ||
| // VolumeTag is the tag for the volume. | ||
| VolumeTag string `json:"volume-tag"` | ||
| + // BindingTag is the tag of an entity to which the | ||
| + // volume's lifetime is bound. |
| +type VolumeAttachmentDetails struct { | ||
| + // NOTE(axw) for backwards-compatibility, this must not be given a | ||
| + // json tag. This ensures that we collapse VolumeAttachmentInfo. | ||
| + VolumeAttachmentInfo |
wallyworld
Mar 3, 2017
Owner
can we add a todo here to remove this compatibility struct when we get a chance to rev up the api
here and below
| @@ -190,6 +191,7 @@ func createStorageDetails(st storageAccess, si state.StorageInstance) (*params.S | ||
| a.Unit().String(), | ||
| machineTag.String(), | ||
| location, | ||
| + params.Life(a.Life().String()), |
wallyworld
Mar 3, 2017
Owner
would prefer named fields
we use named fields below in StorageDetails struct initialisation
| @@ -178,7 +178,8 @@ func (s mockListAPI) ListVolumes(machines []string) ([]params.VolumeDetailsListR | ||
| // storage db-dir/1001, which is attached to unit | ||
| // abc/0. | ||
| { | ||
| - VolumeTag: "volume-0-0", | ||
| + VolumeTag: "volume-0-0", | ||
| + BindingTag: "storage-db-dir-1001", |
|
This PR will be superseded. I'll address comments in the new PR. |
axw
closed this
Mar 3, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
axw commentedFeb 28, 2017
Description of change
When displaying the details of storage in YAML or
JSON format, include the binding and life of the entity.
The binding will be simplified to the kind of the entity,
which is "model", "machine", "application", or "unit".
QA steps
check that the storage includes life and binding fields
Documentation changes
This is primarily for debugging, does not need documentation at present.
Bug reference
None.