gostor / gotgt

Simple Golang iSCSI Target framework
Apache License 2.0
261 stars 49 forks source link

Add flag to disable login on multiple hosts #106

Closed shubham14bajpai closed 3 years ago

shubham14bajpai commented 3 years ago

Signed-off-by: shubham shubham.bajpai@mayadata.io

This PR adds a new flag to enable blocking of login from multiple hosts. This feature is required for implement a RWO volume in kubernetes environment where even though we mention RWO in the persistent volume still in some scenarios multiple pods on different hosts can mount the same volume, ref : https://github.com/openebs/openebs/issues/3404 . This can be prevented from the CSI drivers, but we can not guarantee that pods will not mount the same volume in some edge cases. It is good to reject a new login when a connection already exists to ensure there is no data corruption.

By default, this feature is disabled and can be enabled when creating a new Target object using EnableBlockMultipleHostLogin

kmova commented 3 years ago

cc: @carmark - can you please help with this review.

carmark commented 3 years ago

@kmova sure, @shubham14bajpai thanks for your patch

carmark commented 3 years ago

@shubham14bajpai Could you please also add a flag for the gotgt command?