mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
rbd: use different variable instead of builtin cap
function
`cap` builtin function returns the capacity of a type. Its not good practice to use this builtin function for other variable names, removing it here Ref# https://golang.org/pkg/builtin/#cap Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
2d70e25081
commit
25617929f0
@ -82,8 +82,8 @@ func ValidateNodeUnpublishVolumeRequest(req *csi.NodeUnpublishVolumeRequest) err
|
||||
// CheckReadOnlyManyIsSupported checks the request is to create ReadOnlyMany
|
||||
// volume is from source as empty ReadOnlyMany is not supported.
|
||||
func CheckReadOnlyManyIsSupported(req *csi.CreateVolumeRequest) error {
|
||||
for _, cap := range req.GetVolumeCapabilities() {
|
||||
if m := cap.GetAccessMode().Mode; m == csi.VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY || m == csi.VolumeCapability_AccessMode_SINGLE_NODE_READER_ONLY {
|
||||
for _, capability := range req.GetVolumeCapabilities() {
|
||||
if m := capability.GetAccessMode().Mode; m == csi.VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY || m == csi.VolumeCapability_AccessMode_SINGLE_NODE_READER_ONLY {
|
||||
if req.GetVolumeContentSource() == nil {
|
||||
return status.Error(codes.InvalidArgument, "readOnly accessMode is supported only with content source")
|
||||
}
|
||||
|
Reference in New Issue
Block a user