Merge pull request #131785 from rata/automated-cherry-pick-of-#130243-upstream-release-1.31

Automated cherry pick of #130243: Revert userns kernel check
This commit is contained in:
Kubernetes Prow Robot 2025-06-05 06:12:40 -07:00 committed by GitHub
commit 756c2db4e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 16 deletions

View File

@ -41,7 +41,6 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/sets"
utilvalidation "k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/version"
utilfeature "k8s.io/apiserver/pkg/util/feature"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/klog/v2"
@ -62,7 +61,6 @@ import (
"k8s.io/kubernetes/pkg/kubelet/status"
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
utilfs "k8s.io/kubernetes/pkg/util/filesystem"
utilkernel "k8s.io/kubernetes/pkg/util/kernel"
utilpod "k8s.io/kubernetes/pkg/util/pod"
volumeutil "k8s.io/kubernetes/pkg/volume/util"
"k8s.io/kubernetes/pkg/volume/util/hostutil"
@ -131,16 +129,6 @@ func (kl *Kubelet) getKubeletMappings() (uint32, uint32, error) {
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesSupport) {
return defaultFirstID, defaultLen, nil
} else {
kernelVersion, err := utilkernel.GetVersion()
if err != nil {
return 0, 0, fmt.Errorf("failed to get kernel version, unable to determine if feature %s can be supported : %w",
features.UserNamespacesSupport, err)
}
if kernelVersion != nil && !kernelVersion.AtLeast(version.MustParseGeneric(utilkernel.UserNamespacesSupportKernelVersion)) {
klog.InfoS("WARNING: the kernel version is incompatible with the feature gate, which needs as a minimum kernel version",
"kernelVersion", kernelVersion, "feature", features.UserNamespacesSupport, "minKernelVersion", utilkernel.UserNamespacesSupportKernelVersion)
}
}
// Windows doesn't support user namespaces, let's return the default mappings.

View File

@ -44,10 +44,6 @@ const TCPFinTimeoutNamespacedKernelVersion = "4.6"
// (ref: https://github.com/torvalds/linux/commit/35dfb013149f74c2be1ff9c78f14e6a3cd1539d1)
const IPVSConnReuseModeFixedKernelVersion = "5.9"
// UserNamespacesSupportKernelVersion is the kernel version where idmap for tmpfs support was added
// (ref: https://github.com/torvalds/linux/commit/05e6295f7b5e05f09e369a3eb2882ec5b40fff20)
const UserNamespacesSupportKernelVersion = "6.3"
const TmpfsNoswapSupportKernelVersion = "6.4"
// NFTablesKubeProxyKernelVersion is the lowest kernel version kube-proxy supports using