mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Update mounter interface in volume manager
Update mounter interface in volume manager's ActualStateOfWorld every time. Otherwise kubelet uses the first mounter it gets, which may not have the latest information. This fixes set up of CSI volumes, which store information about SELinux support in their `mounter` interface implementation. With each MountVolume() retry, a new mounter is instantiated and only the final mounter that succeeds has the right info if the volume supports SELinux or not and can later return the right attributes on GetAttributes() call.
This commit is contained in:
parent
902e507824
commit
d3dfe124da
@ -517,6 +517,11 @@ func (asw *actualStateOfWorld) AddPodToVolume(markVolumeOpts operationexecutor.M
|
||||
// If pod exists, reset remountRequired value
|
||||
podObj.remountRequired = false
|
||||
podObj.volumeMountStateForPod = markVolumeOpts.VolumeMountState
|
||||
if mounter != nil {
|
||||
// The mounter stored in the object may have old information,
|
||||
// use the newest one.
|
||||
podObj.mounter = mounter
|
||||
}
|
||||
asw.attachedVolumes[volumeName].mountedPods[podName] = podObj
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user