mirror of https://github.com/k3s-io/k3s
Set sizeLimit to the smaller of the ephemeral storage limit and the emptydir limit (if set)
parent
9f4a4d1f49
commit
38753efcc7
|
@ -238,6 +238,12 @@ func (dsw *desiredStateOfWorld) AddPodToVolume(
|
||||||
_, podLimits := apiv1resource.PodRequestsAndLimits(pod)
|
_, podLimits := apiv1resource.PodRequestsAndLimits(pod)
|
||||||
ephemeralStorageLimit := podLimits[v1.ResourceEphemeralStorage]
|
ephemeralStorageLimit := podLimits[v1.ResourceEphemeralStorage]
|
||||||
sizeLimit = resource.NewQuantity(ephemeralStorageLimit.Value(), resource.BinarySI)
|
sizeLimit = resource.NewQuantity(ephemeralStorageLimit.Value(), resource.BinarySI)
|
||||||
|
if volumeSpec.Volume.EmptyDir != nil &&
|
||||||
|
volumeSpec.Volume.EmptyDir.SizeLimit != nil &&
|
||||||
|
volumeSpec.Volume.EmptyDir.SizeLimit.Value() > 0 &&
|
||||||
|
volumeSpec.Volume.EmptyDir.SizeLimit.Value() < sizeLimit.Value() {
|
||||||
|
sizeLimit = resource.NewQuantity(volumeSpec.Volume.EmptyDir.SizeLimit.Value(), resource.BinarySI)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dsw.volumesToMount[volumeName] = volumeToMount{
|
dsw.volumesToMount[volumeName] = volumeToMount{
|
||||||
|
|
Loading…
Reference in New Issue