mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #113405 from jsafrane/reduce-log-noise-on-selinux
Reduce log noise on SELinux mount mismatch
This commit is contained in:
commit
f892ab1bd7
@ -1185,7 +1185,7 @@ type seLinuxMountMismatchError struct {
|
|||||||
|
|
||||||
func (err seLinuxMountMismatchError) Error() string {
|
func (err seLinuxMountMismatchError) Error() string {
|
||||||
return fmt.Sprintf(
|
return fmt.Sprintf(
|
||||||
"volumeName %q is already mounted to a different pod with a different SELinux label",
|
"waiting for unmount of volume %q, because it is already mounted to a different pod with a different SELinux label",
|
||||||
err.volumeName)
|
err.volumeName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,10 +220,11 @@ func (rc *reconciler) mountOrAttachVolumes() {
|
|||||||
volMounted, devicePath, err := rc.actualStateOfWorld.PodExistsInVolume(volumeToMount.PodName, volumeToMount.VolumeName, volumeToMount.PersistentVolumeSize, volumeToMount.SELinuxLabel)
|
volMounted, devicePath, err := rc.actualStateOfWorld.PodExistsInVolume(volumeToMount.PodName, volumeToMount.VolumeName, volumeToMount.PersistentVolumeSize, volumeToMount.SELinuxLabel)
|
||||||
volumeToMount.DevicePath = devicePath
|
volumeToMount.DevicePath = devicePath
|
||||||
if cache.IsSELinuxMountMismatchError(err) {
|
if cache.IsSELinuxMountMismatchError(err) {
|
||||||
// TODO: check error message + lower frequency, this can be noisy
|
// The volume is mounted, but with an unexpected SELinux context.
|
||||||
klog.ErrorS(err, volumeToMount.GenerateErrorDetailed("mount precondition failed, please report this error in https://github.com/kubernetes/enhancements/issues/1710, together with full Pod yaml file", err).Error(), "pod", klog.KObj(volumeToMount.Pod))
|
// It will get unmounted in unmountVolumes / unmountDetachDevices and
|
||||||
// TODO: report error better, this may be too noisy
|
// then removed from actualStateOfWorld.
|
||||||
rc.desiredStateOfWorld.AddErrorToPod(volumeToMount.PodName, err.Error())
|
rc.desiredStateOfWorld.AddErrorToPod(volumeToMount.PodName, err.Error())
|
||||||
|
continue
|
||||||
} else if cache.IsVolumeNotAttachedError(err) {
|
} else if cache.IsVolumeNotAttachedError(err) {
|
||||||
rc.waitForVolumeAttach(volumeToMount)
|
rc.waitForVolumeAttach(volumeToMount)
|
||||||
} else if !volMounted || cache.IsRemountRequiredError(err) {
|
} else if !volMounted || cache.IsRemountRequiredError(err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user