A mount option can contain commas in double quoted string. Such comma is
part of the mount option and it is not option separator.
For example, this is a single mount option:
context="system_u:object_r:container_file_t:s0:c460,c902"
The field in fact says that the container runtime should relabel a volume
when running a container with it, it does not say that the volume supports
SELinux. For example, NFS can support SELinux, but we don't want NFS
volumes relabeled, because they can be shared among several Pods.
this commit updates checkEphemeralStorage to be able to add container log stats, if applicable.
It also updates the old check when container log stats aren't found to be more accurate.
Specifically, this check previously worked because of a fluke programming accident:
according to this block in pkg/kubelet/stats/helper.go:113
```
if result.Rootfs != nil {
rootfsUsage := *cfs.BaseUsageBytes
result.Rootfs.UsedBytes = &rootfsUsage
}
```
BaseUsageBytes should be the value added, not TotalUsageBytes. However, since in this case
one also needs to account for the calculated log size, which is TotalUsageBytes - BaseUsageBytes
using TotalUsageBytes value accidentally worked.
Updating the case to use the correct value AND log offset fixes this accident and makes
the behavior more in line with what happens when calculating ephemeral storage.
Signed-off-by: Peter Hunt <pehunt@redhat.com>
in https://github.com/kubernetes/kubernetes/pull/74441,
the namespace and name were added to the pod log location.
However, cAdvisor stats provider wasn't correspondingly updated.
since CRI-O uses cAdvisor stats provider by default, despite being a CRI implementation,
eviction with ephemeral storage and container logs doesn't work as expected, until now!
Signed-off-by: Peter Hunt <pehunt@redhat.com>
The kubeadm defaults in features.go differ between versions.
e2e_kubeadm tests cannot import the kubeadm features.go,
or easily detect the versioned of the kubeadm binary used
to create the cluster.
Check for the existence of both versioned and unversioned
objects independent of the value of the FG. Once the FG
goes GA only the unversioned objects should be checked.
Without this change kubeadm e2e skew tests will fail where kubeadm
is at 1.24 (has the FG defaulted to true), the FG is not
explicitly set by the user and the k8s version is at 1.23.