Skip to content

Commit

Permalink
Changes to add to root clients for ROVoleFromSnapshot and RCE is true (
Browse files Browse the repository at this point in the history
  • Loading branch information
randeepdell authored Aug 3, 2022
1 parent 026daa1 commit 0b20979
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions service/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ func (s *service) CreateVolume(
// check volume content source in the request
isROVolumeFromSnapshot = false
if contentSource = req.GetVolumeContentSource(); contentSource != nil {

// Fetch source snapshot ID or volume ID from content source
if snapshot := contentSource.GetSnapshot(); snapshot != nil {
normalizedSnapshotID := snapshot.GetSnapshotId()
Expand Down Expand Up @@ -1130,7 +1129,13 @@ func (s *service) ControllerPublishVolume(
err = isiConfig.isiSvc.AddExportClientNetworkIdentifierByIDWithZone(ctx, clusterName, exportID, accessZone, nodeID, isiConfig.isiSvc.AddExportClientByIDWithZone)
}
case csi.VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY:
err = isiConfig.isiSvc.AddExportClientNetworkIdentifierByIDWithZone(ctx, clusterName, exportID, accessZone, nodeID, isiConfig.isiSvc.AddExportReadOnlyClientByIDWithZone)
//since read-only has higher privileges than root-clients, add to root-clients in exports on powerscale if root client enabled is set to true
if rootClientEnabled && isROVolumeFromSnapshot {
log.Info("ROVolumeFromSnapshot & rootClientEnabled is set to true, add to root clients")
err = isiConfig.isiSvc.AddExportClientNetworkIdentifierByIDWithZone(ctx, clusterName, exportID, accessZone, nodeID, isiConfig.isiSvc.AddExportRootClientByIDWithZone)
} else {
err = isiConfig.isiSvc.AddExportClientNetworkIdentifierByIDWithZone(ctx, clusterName, exportID, accessZone, nodeID, isiConfig.isiSvc.AddExportReadOnlyClientByIDWithZone)
}
case csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER,
csi.VolumeCapability_AccessMode_SINGLE_NODE_SINGLE_WRITER,
csi.VolumeCapability_AccessMode_SINGLE_NODE_MULTI_WRITER:
Expand Down

0 comments on commit 0b20979

Please sign in to comment.