mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 04:52:08 +00:00
remove wrong warning event (FileSystemResizeFailed) during a pod creation when it uses a readonly volume.
This commit is contained in:
parent
1b6b3ba013
commit
5607349e39
@ -2081,6 +2081,9 @@ func (og *operationGenerator) expandVolumeDuringMount(volumeToMount VolumeToMoun
|
|||||||
return false, fmt.Errorf("mountVolume.NodeExpandVolume get PVC failed : %v", err)
|
return false, fmt.Errorf("mountVolume.NodeExpandVolume get PVC failed : %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pvcStatusCap := pvc.Status.Capacity[v1.ResourceStorage]
|
||||||
|
pvSpecCap := pv.Spec.Capacity[v1.ResourceStorage]
|
||||||
|
if pvcStatusCap.Cmp(pvSpecCap) < 0 {
|
||||||
if volumeToMount.VolumeSpec.ReadOnly {
|
if volumeToMount.VolumeSpec.ReadOnly {
|
||||||
simpleMsg, detailedMsg := volumeToMount.GenerateMsg("MountVolume.NodeExpandVolume failed", "requested read-only file system")
|
simpleMsg, detailedMsg := volumeToMount.GenerateMsg("MountVolume.NodeExpandVolume failed", "requested read-only file system")
|
||||||
klog.Warningf(detailedMsg)
|
klog.Warningf(detailedMsg)
|
||||||
@ -2088,9 +2091,7 @@ func (og *operationGenerator) expandVolumeDuringMount(volumeToMount VolumeToMoun
|
|||||||
og.recorder.Eventf(pvc, v1.EventTypeWarning, kevents.FileSystemResizeFailed, simpleMsg)
|
og.recorder.Eventf(pvc, v1.EventTypeWarning, kevents.FileSystemResizeFailed, simpleMsg)
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
pvcStatusCap := pvc.Status.Capacity[v1.ResourceStorage]
|
|
||||||
pvSpecCap := pv.Spec.Capacity[v1.ResourceStorage]
|
|
||||||
if pvcStatusCap.Cmp(pvSpecCap) < 0 {
|
|
||||||
rsOpts.NewSize = pvSpecCap
|
rsOpts.NewSize = pvSpecCap
|
||||||
rsOpts.OldSize = pvcStatusCap
|
rsOpts.OldSize = pvcStatusCap
|
||||||
resizeOp := nodeResizeOperationOpts{
|
resizeOp := nodeResizeOperationOpts{
|
||||||
|
Loading…
Reference in New Issue
Block a user