11644: Add volume replication level to /mounts response.
authorTom Clegg <tom@curoverse.com>
Tue, 16 May 2017 17:22:42 +0000 (13:22 -0400)
committerTom Clegg <tom@curoverse.com>
Tue, 16 May 2017 17:22:42 +0000 (13:22 -0400)
services/keepstore/volume.go

index d23fcc81d4902d7ca28c442c2fba935d15914d3d..836e8c6fdc918c94be128bee0399c93f89d4c6cf 100644 (file)
@@ -275,11 +275,12 @@ type VolumeManager interface {
 
 // A VolumeMount is an attachment of a Volume to a VolumeManager.
 type VolumeMount struct {
-       UUID     string
-       DeviceID string
-       ReadOnly bool
-       Tier     int
-       volume   Volume
+       UUID        string
+       DeviceID    string
+       ReadOnly    bool
+       Replication int
+       Tier        int
+       volume      Volume
 }
 
 // Generate a UUID the way API server would for a "KeepVolumeMount"
@@ -317,11 +318,12 @@ func MakeRRVolumeManager(volumes []Volume) *RRVolumeManager {
        vm.mountMap = make(map[string]*VolumeMount)
        for _, v := range volumes {
                mnt := &VolumeMount{
-                       UUID:     (*VolumeMount)(nil).generateUUID(),
-                       DeviceID: "",
-                       ReadOnly: !v.Writable(),
-                       Tier:     1,
-                       volume:   v,
+                       UUID:        (*VolumeMount)(nil).generateUUID(),
+                       DeviceID:    "",
+                       ReadOnly:    !v.Writable(),
+                       Replication: v.Replication(),
+                       Tier:        1,
+                       volume:      v,
                }
                if v, ok := v.(interface {
                        DeviceID() string