diff --git a/cmd/kubelet/app/options/container_runtime.go b/cmd/kubelet/app/options/container_runtime.go index 795594b6a13..3e0b1e4cf16 100644 --- a/cmd/kubelet/app/options/container_runtime.go +++ b/cmd/kubelet/app/options/container_runtime.go @@ -18,7 +18,6 @@ package options import ( "k8s.io/kubernetes/pkg/kubelet/config" - kubetypes "k8s.io/kubernetes/pkg/kubelet/types" ) const ( @@ -36,7 +35,6 @@ var ( // default values. func NewContainerRuntimeOptions() *config.ContainerRuntimeOptions { return &config.ContainerRuntimeOptions{ - ContainerRuntime: kubetypes.RemoteContainerRuntime, - PodSandboxImage: defaultPodSandboxImage, + PodSandboxImage: defaultPodSandboxImage, } } diff --git a/cmd/kubelet/app/options/options.go b/cmd/kubelet/app/options/options.go index fe5467d65c2..bba7c05c41a 100644 --- a/cmd/kubelet/app/options/options.go +++ b/cmd/kubelet/app/options/options.go @@ -33,11 +33,11 @@ import ( "k8s.io/kubelet/config/v1beta1" kubeletapis "k8s.io/kubelet/pkg/apis" "k8s.io/kubernetes/pkg/cluster/ports" + "k8s.io/kubernetes/pkg/features" kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config" kubeletscheme "k8s.io/kubernetes/pkg/kubelet/apis/config/scheme" kubeletconfigvalidation "k8s.io/kubernetes/pkg/kubelet/apis/config/validation" "k8s.io/kubernetes/pkg/kubelet/config" - kubetypes "k8s.io/kubernetes/pkg/kubelet/types" utilflag "k8s.io/kubernetes/pkg/util/flag" ) @@ -179,8 +179,8 @@ func ValidateKubeletFlags(f *KubeletFlags) error { return fmt.Errorf("invalid node labels: %s", strings.Join(labelErrs, "; ")) } - if f.ContainerRuntime != kubetypes.RemoteContainerRuntime { - return fmt.Errorf("unsupported CRI runtime: %q, only %q is currently supported", f.ContainerRuntime, kubetypes.RemoteContainerRuntime) + if f.SeccompDefault && !utilfeature.DefaultFeatureGate.Enabled(features.SeccompDefault) { + return fmt.Errorf("the SeccompDefault feature gate must be enabled in order to use the --seccomp-default flag") } return nil diff --git a/cmd/kubelet/app/options/options_test.go b/cmd/kubelet/app/options/options_test.go index e306d7ea914..9abfbd9d06e 100644 --- a/cmd/kubelet/app/options/options_test.go +++ b/cmd/kubelet/app/options/options_test.go @@ -26,7 +26,6 @@ import ( "k8s.io/apimachinery/pkg/util/diff" cliflag "k8s.io/component-base/cli/flag" "k8s.io/kubernetes/pkg/kubelet/config" - kubetypes "k8s.io/kubernetes/pkg/kubelet/types" ) func newKubeletServerOrDie() *KubeletServer { @@ -180,10 +179,8 @@ func TestValidateKubeletFlags(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { err := ValidateKubeletFlags(&KubeletFlags{ - ContainerRuntimeOptions: config.ContainerRuntimeOptions{ - ContainerRuntime: kubetypes.RemoteContainerRuntime, - }, - NodeLabels: tt.labels, + ContainerRuntimeOptions: config.ContainerRuntimeOptions{}, + NodeLabels: tt.labels, }) if tt.error && err == nil { diff --git a/pkg/kubelet/config/flags.go b/pkg/kubelet/config/flags.go index 45ee304f9b2..40d4a2ce1db 100644 --- a/pkg/kubelet/config/flags.go +++ b/pkg/kubelet/config/flags.go @@ -26,8 +26,6 @@ import ( type ContainerRuntimeOptions struct { // General Options. - // ContainerRuntime is the container runtime to use. - ContainerRuntime string // RuntimeCgroups that container runtime is expected to be isolated in. RuntimeCgroups string // PodSandboxImage is the image whose network/ipc namespaces @@ -51,8 +49,6 @@ type ContainerRuntimeOptions struct { // AddFlags adds flags to the container runtime, according to ContainerRuntimeOptions. func (s *ContainerRuntimeOptions) AddFlags(fs *pflag.FlagSet) { // General settings. - fs.StringVar(&s.ContainerRuntime, "container-runtime", s.ContainerRuntime, "The container runtime to use. Possible value: 'remote'.") - fs.MarkDeprecated("container-runtime", "will be removed in 1.27 as the only valid value is 'remote'") fs.StringVar(&s.RuntimeCgroups, "runtime-cgroups", s.RuntimeCgroups, "Optional absolute name of cgroups to create and run the runtime in.") fs.StringVar(&s.PodSandboxImage, "pod-infra-container-image", s.PodSandboxImage, fmt.Sprintf("Specified image will not be pruned by the image garbage collector. CRI implementations have their own configuration to set this image.")) fs.MarkDeprecated("pod-infra-container-image", "will be removed in 1.27. Image garbage collector will get sandbox image information from CRI.") diff --git a/pkg/kubelet/types/constants.go b/pkg/kubelet/types/constants.go index 14c64525364..32af6d6baa4 100644 --- a/pkg/kubelet/types/constants.go +++ b/pkg/kubelet/types/constants.go @@ -25,11 +25,6 @@ const ( RFC3339NanoLenient = "2006-01-02T15:04:05.999999999Z07:00" ) -// Different container runtimes. -const ( - RemoteContainerRuntime = "remote" -) - // User visible keys for managing node allocatable enforcement on the node. const ( NodeAllocatableEnforcementKey = "pods"