Skip to content

Commit 756c2db

Browse files
authored
Merge pull request kubernetes#131785 from rata/automated-cherry-pick-of-#130243-upstream-release-1.31
Automated cherry pick of kubernetes#130243: Revert userns kernel check
2 parents b62290a + 1e53e59 commit 756c2db

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

pkg/kubelet/kubelet_pods.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import (
4141
"k8s.io/apimachinery/pkg/types"
4242
"k8s.io/apimachinery/pkg/util/sets"
4343
utilvalidation "k8s.io/apimachinery/pkg/util/validation"
44-
"k8s.io/apimachinery/pkg/util/version"
4544
utilfeature "k8s.io/apiserver/pkg/util/feature"
4645
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
4746
"k8s.io/klog/v2"
@@ -62,7 +61,6 @@ import (
6261
"k8s.io/kubernetes/pkg/kubelet/status"
6362
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
6463
utilfs "k8s.io/kubernetes/pkg/util/filesystem"
65-
utilkernel "k8s.io/kubernetes/pkg/util/kernel"
6664
utilpod "k8s.io/kubernetes/pkg/util/pod"
6765
volumeutil "k8s.io/kubernetes/pkg/volume/util"
6866
"k8s.io/kubernetes/pkg/volume/util/hostutil"
@@ -131,16 +129,6 @@ func (kl *Kubelet) getKubeletMappings() (uint32, uint32, error) {
131129

132130
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesSupport) {
133131
return defaultFirstID, defaultLen, nil
134-
} else {
135-
kernelVersion, err := utilkernel.GetVersion()
136-
if err != nil {
137-
return 0, 0, fmt.Errorf("failed to get kernel version, unable to determine if feature %s can be supported : %w",
138-
features.UserNamespacesSupport, err)
139-
}
140-
if kernelVersion != nil && !kernelVersion.AtLeast(version.MustParseGeneric(utilkernel.UserNamespacesSupportKernelVersion)) {
141-
klog.InfoS("WARNING: the kernel version is incompatible with the feature gate, which needs as a minimum kernel version",
142-
"kernelVersion", kernelVersion, "feature", features.UserNamespacesSupport, "minKernelVersion", utilkernel.UserNamespacesSupportKernelVersion)
143-
}
144132
}
145133

146134
// Windows doesn't support user namespaces, let's return the default mappings.

pkg/util/kernel/constants.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ const TCPFinTimeoutNamespacedKernelVersion = "4.6"
4444
// (ref: https://github.com/torvalds/linux/commit/35dfb013149f74c2be1ff9c78f14e6a3cd1539d1)
4545
const IPVSConnReuseModeFixedKernelVersion = "5.9"
4646

47-
// UserNamespacesSupportKernelVersion is the kernel version where idmap for tmpfs support was added
48-
// (ref: https://github.com/torvalds/linux/commit/05e6295f7b5e05f09e369a3eb2882ec5b40fff20)
49-
const UserNamespacesSupportKernelVersion = "6.3"
50-
5147
const TmpfsNoswapSupportKernelVersion = "6.4"
5248

5349
// NFTablesKubeProxyKernelVersion is the lowest kernel version kube-proxy supports using

0 commit comments

Comments
 (0)