File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -82,12 +82,16 @@ func ValidateNodeUnpublishVolumeRequest(req *csi.NodeUnpublishVolumeRequest) err
8282// CheckReadOnlyManyIsSupported checks the request is to create ReadOnlyMany
8383// volume is from source as empty ReadOnlyMany is not supported.
8484func CheckReadOnlyManyIsSupported (req * csi.CreateVolumeRequest ) error {
85+ writable := false
8586 for _ , capability := range req .GetVolumeCapabilities () {
8687 if m := capability .GetAccessMode ().Mode ; m == csi .VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY || m == csi .VolumeCapability_AccessMode_SINGLE_NODE_READER_ONLY {
87- if req . GetVolumeContentSource () == nil {
88- return status . Error ( codes . InvalidArgument , "readOnly accessMode is supported only with content source" )
89- }
88+ // do nothing
89+ } else {
90+ writable = true
9091 }
9192 }
93+ if ! writable && req .GetVolumeContentSource () == nil {
94+ return status .Error (codes .InvalidArgument , "readOnly accessMode is supported only with content source" )
95+ }
9296 return nil
9397}
You can’t perform that action at this time.
0 commit comments