Skip to content

Commit

Permalink
Update node.go
Browse files Browse the repository at this point in the history
Added changes for RDM volumes
  • Loading branch information
Lakshmi3004 authored Jul 24, 2023
1 parent 0f942f7 commit 93c540d
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions service/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1066,12 +1066,9 @@ func (s *service) NodeGetInfo(
maxPowerMaxVolumesPerNode = 0
}
if s.opts.IsVsphereEnabled {
if maxPowerMaxVolumesPerNode < 0 {
log.Errorf("Node label max-powermax-volumes-per-node should not be set to negative value for RDM volumes, Setting to default value 60")
if maxPowerMaxVolumesPerNode < 0 || maxPowerMaxVolumesPerNode > 60 {
log.Errorf("Node label max-powermax-volumes-per-node should not be greater than 60 or set to any negative value for RDM volumes, Setting to default value 60")
}
if maxPowerMaxVolumesPerNode > 60 {
log.Errorf("For RDM volumes, Maximum volumes per Node cannot be greater than 60, Setting value to 60")
}
maxPowerMaxVolumesPerNode = 60
}
log.Infof("node label 'max-powermax-volumes-per-node' is available and is set to value '%v'", maxPowerMaxVolumesPerNode)
Expand All @@ -1083,16 +1080,13 @@ func (s *service) NodeGetInfo(
s.opts.MaxVolumesPerNode = 0
}
if s.opts.IsVsphereEnabled {
if s.opts.MaxVolumesPerNode < 0 {
log.Errorf("maxPowerMaxVolumesPerNode MUST NOT be set to negative value for RDM volumes. Setting to default value 60")
}
if s.opts.MaxVolumesPerNode > 60 {
log.Errorf("For RDM volumes, Maximum volumes per Node cannot be greater than 60, Setting value to 60")
if s.opts.MaxVolumesPerNode < 0 || s.opts.MaxVolumesPerNode > 60 {
log.Errorf("maxPowerMaxVolumesPerNode MUST NOT be greater than 60 or set to any negative value for RDM volumes. Setting to default value 60")
}
s.opts.MaxVolumesPerNode = 60
}
maxPowerMaxVolumesPerNode = s.opts.MaxVolumesPerNode
log.Infof("Node label 'max-powermax-volumes-per-node' is not available. Using default volume limit '%v'", maxPowerMaxVolumesPerNode)
maxPowerMaxVolumesPerNode = s.opts.MaxVolumesPerNode
log.Infof("Node label 'max-powermax-volumes-per-node' is not available. Using default volume limit '%v'", maxPowerMaxVolumesPerNode)
}
return &csi.NodeGetInfoResponse{
NodeId: s.opts.NodeName,
Expand Down

0 comments on commit 93c540d

Please sign in to comment.