Skip to content

Commit

Permalink
Merge pull request kubernetes#29622 from rootfs/rbd-ro
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

allow a read-only rbd image mounted by multiple pods

allow pod to run read-only rbd volume 
fix kubernetes#27725
  • Loading branch information
Kubernetes Submit Queue authored Aug 8, 2016
2 parents e19ea41 + 730db45 commit faffbe4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugin/pkg/scheduler/algorithm/predicates/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ func isVolumeConflict(volume api.Volume, pod *api.Pod) bool {
if volume.RBD != nil && existingVolume.RBD != nil {
mon, pool, image := volume.RBD.CephMonitors, volume.RBD.RBDPool, volume.RBD.RBDImage
emon, epool, eimage := existingVolume.RBD.CephMonitors, existingVolume.RBD.RBDPool, existingVolume.RBD.RBDImage
if haveSame(mon, emon) && pool == epool && image == eimage {
// two RBDs images are the same if they share the same Ceph monitor, are in the same RADOS Pool, and have the same image name
// only one read-write mount is permitted for the same RBD image.
// same RBD image mounted by multiple Pods conflicts unless all Pods mount the image read-only
if haveSame(mon, emon) && pool == epool && image == eimage && !(volume.RBD.ReadOnly && existingVolume.RBD.ReadOnly) {
return true
}
}
Expand Down

0 comments on commit faffbe4

Please sign in to comment.