Fix issue 64119.

This commit is contained in:
Tardis Xu 2018-05-24 23:48:19 +08:00
parent 481b2dc7cf
commit 56289ef3f8
2 changed files with 5 additions and 0 deletions

View File

@ -329,6 +329,7 @@ func TestPlugin(t *testing.T) {
RBDPool: "pool1",
RBDImage: "image1",
FSType: "ext4",
ReadOnly: true,
},
},
}),

View File

@ -399,6 +399,10 @@ func (util *RBDUtil) AttachDisk(b rbdMounter) (string, error) {
break
}
}
} else {
// ReadOnly rbd volume should not check rbd status of being used to
// support mounted as read-only by multiple consumers simultaneously.
needValidUsed = !b.rbd.ReadOnly
}
err := wait.ExponentialBackoff(backoff, func() (bool, error) {
used, rbdOutput, err := util.rbdStatus(&b)