@@ -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"
@@ -63,7 +62,6 @@ import (
63
62
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
64
63
"k8s.io/kubernetes/pkg/kubelet/util/format"
65
64
utilfs "k8s.io/kubernetes/pkg/util/filesystem"
66
- utilkernel "k8s.io/kubernetes/pkg/util/kernel"
67
65
utilpod "k8s.io/kubernetes/pkg/util/pod"
68
66
volumeutil "k8s.io/kubernetes/pkg/volume/util"
69
67
"k8s.io/kubernetes/pkg/volume/util/hostutil"
@@ -132,16 +130,6 @@ func (kl *Kubelet) getKubeletMappings() (uint32, uint32, error) {
132
130
133
131
if ! utilfeature .DefaultFeatureGate .Enabled (features .UserNamespacesSupport ) {
134
132
return defaultFirstID , defaultLen , nil
135
- } else {
136
- kernelVersion , err := utilkernel .GetVersion ()
137
- if err != nil {
138
- return 0 , 0 , fmt .Errorf ("failed to get kernel version, unable to determine if feature %s can be supported : %w" ,
139
- features .UserNamespacesSupport , err )
140
- }
141
- if kernelVersion != nil && ! kernelVersion .AtLeast (version .MustParseGeneric (utilkernel .UserNamespacesSupportKernelVersion )) {
142
- klog .InfoS ("WARNING: the kernel version is incompatible with the feature gate, which needs as a minimum kernel version" ,
143
- "kernelVersion" , kernelVersion , "feature" , features .UserNamespacesSupport , "minKernelVersion" , utilkernel .UserNamespacesSupportKernelVersion )
144
- }
145
133
}
146
134
147
135
_ , err := user .Lookup (kubeletUser )
0 commit comments