File tree 2 files changed +15
-10
lines changed
2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,11 @@ func (s *service) ControllerPublishVolume(
227
227
v .VolumeContext [ReadOnlyKey ] = roVal
228
228
s .vols [i ] = v
229
229
230
+ if volInfo , ok := MockVolumes [req .VolumeId ]; ok {
231
+ volInfo .ISControllerPublished = true
232
+ MockVolumes [req .VolumeId ] = volInfo
233
+ }
234
+
230
235
if hookVal , hookMsg := s .execHook ("ControllerPublishVolumeEnd" ); hookVal != codes .OK {
231
236
return nil , status .Errorf (hookVal , hookMsg )
232
237
}
@@ -623,8 +628,8 @@ func (s *service) ControllerExpandVolume(
623
628
return nil , status .Error (codes .NotFound , req .VolumeId )
624
629
}
625
630
626
- if s .config .DisableOnlineExpansion && MockVolumes [v .GetVolumeId ()].ISPublished {
627
- return nil , status .Error (codes .Aborted , "volume is published and online volume expansion is not supported" )
631
+ if s .config .DisableOnlineExpansion && MockVolumes [v .GetVolumeId ()].ISControllerPublished {
632
+ return nil , status .Error (codes .FailedPrecondition , "volume is published and online volume expansion is not supported" )
628
633
}
629
634
630
635
requestBytes := req .CapacityRange .RequiredBytes
Original file line number Diff line number Diff line change @@ -109,14 +109,14 @@ type service struct {
109
109
}
110
110
111
111
type Volume struct {
112
- sync. Mutex
113
- VolumeCSI csi. Volume
114
- NodeID string
115
- ISStaged bool
116
- ISPublished bool
117
- ISEphemeral bool
118
- StageTargetPath string
119
- TargetPath string
112
+ VolumeCSI csi. Volume
113
+ NodeID string
114
+ ISStaged bool
115
+ ISPublished bool
116
+ ISEphemeral bool
117
+ ISControllerPublished bool
118
+ StageTargetPath string
119
+ TargetPath string
120
120
}
121
121
122
122
var MockVolumes map [string ]Volume
You can’t perform that action at this time.
0 commit comments