Merge pull request #111859 from omertuc/fixparallelclosure2

Fix failing `test/e2e/storage/csi_mock_volume.go` test
This commit is contained in:
Kubernetes Prow Robot 2022-08-17 09:09:11 -07:00 committed by GitHub
commit 93054957c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1731,8 +1731,8 @@ var _ = utils.SIGDescribe("CSI mock volume", func() {
},
}
for _, t := range tests {
test := t
ginkgo.It(test.name, func() {
t := t
ginkgo.It(t.name, func() {
var nodeStageFsGroup, nodePublishFsGroup string
if framework.NodeOSDistroIs("windows") {
e2eskipper.Skipf("FSGroupPolicy is only applied on linux nodes -- skipping")
@ -1740,7 +1740,7 @@ var _ = utils.SIGDescribe("CSI mock volume", func() {
init(testParameters{
disableAttach: true,
registerDriver: true,
enableVolumeMountGroup: test.enableVolumeMountGroup,
enableVolumeMountGroup: t.enableVolumeMountGroup,
hooks: createFSGroupRequestPreHook(&nodeStageFsGroup, &nodePublishFsGroup),
})
defer cleanup()
@ -2479,14 +2479,14 @@ func createPreHook(method string, callback func(counter int64) error) *drivers.H
func createFSGroupRequestPreHook(nodeStageFsGroup, nodePublishFsGroup *string) *drivers.Hooks {
return &drivers.Hooks{
Pre: func(ctx context.Context, fullMethod string, request interface{}) (reply interface{}, err error) {
nodeStageRequest, ok := request.(csipbv1.NodeStageVolumeRequest)
nodeStageRequest, ok := request.(*csipbv1.NodeStageVolumeRequest)
if ok {
mountVolume := nodeStageRequest.GetVolumeCapability().GetMount()
if mountVolume != nil {
*nodeStageFsGroup = mountVolume.VolumeMountGroup
}
}
nodePublishRequest, ok := request.(csipbv1.NodePublishVolumeRequest)
nodePublishRequest, ok := request.(*csipbv1.NodePublishVolumeRequest)
if ok {
mountVolume := nodePublishRequest.GetVolumeCapability().GetMount()
if mountVolume != nil {