@@ -41,7 +41,6 @@ import (
41
41
"k8s.io/apimachinery/pkg/types"
42
42
"k8s.io/apimachinery/pkg/util/sets"
43
43
utilvalidation "k8s.io/apimachinery/pkg/util/validation"
44
- "k8s.io/apimachinery/pkg/util/version"
45
44
utilfeature "k8s.io/apiserver/pkg/util/feature"
46
45
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
47
46
"k8s.io/klog/v2"
@@ -62,7 +61,6 @@ import (
62
61
"k8s.io/kubernetes/pkg/kubelet/status"
63
62
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
64
63
utilfs "k8s.io/kubernetes/pkg/util/filesystem"
65
- utilkernel "k8s.io/kubernetes/pkg/util/kernel"
66
64
utilpod "k8s.io/kubernetes/pkg/util/pod"
67
65
volumeutil "k8s.io/kubernetes/pkg/volume/util"
68
66
"k8s.io/kubernetes/pkg/volume/util/hostutil"
@@ -131,16 +129,6 @@ func (kl *Kubelet) getKubeletMappings() (uint32, uint32, error) {
131
129
132
130
if ! utilfeature .DefaultFeatureGate .Enabled (features .UserNamespacesSupport ) {
133
131
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
- }
144
132
}
145
133
146
134
// Windows doesn't support user namespaces, let's return the default mappings.
0 commit comments