mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
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:
commit
756c2db4e8
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user