From 6cdb1c225dca5f88a84cdbc7e01fd8ec73712d2c Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Sat, 18 Dec 2021 12:18:25 +0200 Subject: [PATCH] Clean up dockerless build tag Signed-off-by: Ciprian Hacman --- hack/make-rules/verify.sh | 1 - hack/verify-typecheck-dockerless.sh | 34 -------------------- pkg/kubelet/kubelet_dockerless_test.go | 34 -------------------- pkg/kubelet/kubelet_dockershim_nodocker.go | 37 ---------------------- pkg/kubelet/legacy/logs.go | 11 ------- 5 files changed, 117 deletions(-) delete mode 100755 hack/verify-typecheck-dockerless.sh delete mode 100644 pkg/kubelet/kubelet_dockerless_test.go delete mode 100644 pkg/kubelet/kubelet_dockershim_nodocker.go diff --git a/hack/make-rules/verify.sh b/hack/make-rules/verify.sh index f4da3be4e3c..d3cec85c8c6 100755 --- a/hack/make-rules/verify.sh +++ b/hack/make-rules/verify.sh @@ -49,7 +49,6 @@ if [[ ${EXCLUDE_TYPECHECK:-} =~ ^[yY]$ ]]; then EXCLUDED_PATTERNS+=( "verify-typecheck.sh" # runs in separate typecheck job "verify-typecheck-providerless.sh" # runs in separate typecheck job - "verify-typecheck-dockerless.sh" # runs in separate typecheck job ) fi diff --git a/hack/verify-typecheck-dockerless.sh b/hack/verify-typecheck-dockerless.sh deleted file mode 100755 index d8f95e6b2ec..00000000000 --- a/hack/verify-typecheck-dockerless.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2018 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. - -cd "${KUBE_ROOT}" -# verify the dockerless build -# https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/1547-building-kubelet-without-docker/README.md -hack/verify-typecheck.sh --skip-test --tags=dockerless --ignore-dirs=test - -# verify using go list -if _out="$(go list -mod=readonly -tags "dockerless" -e -json k8s.io/kubernetes/cmd/kubelet/... \ - | grep -e dockershim)"; then - echo "${_out}" >&2 - echo "Verify typecheck for dockerless tag failed. Found restricted packages." >&2 - exit 1 -fi diff --git a/pkg/kubelet/kubelet_dockerless_test.go b/pkg/kubelet/kubelet_dockerless_test.go deleted file mode 100644 index 3a494fd9a31..00000000000 --- a/pkg/kubelet/kubelet_dockerless_test.go +++ /dev/null @@ -1,34 +0,0 @@ -//go:build dockerless -// +build dockerless - -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package kubelet_test - -import ( - "testing" - - "k8s.io/kubernetes/pkg/kubelet" - kubetypes "k8s.io/kubernetes/pkg/kubelet/types" -) - -func TestPreInitRuntimeService(t *testing.T) { - err := kubelet.PreInitRuntimeService(nil, nil, nil, kubetypes.DockerContainerRuntime, "", "", "", "") - if err == nil { - t.Fatal("PreInitRuntimeService should fail when configured to use docker and compiled dockerless") - } -} diff --git a/pkg/kubelet/kubelet_dockershim_nodocker.go b/pkg/kubelet/kubelet_dockershim_nodocker.go deleted file mode 100644 index 85dbc449791..00000000000 --- a/pkg/kubelet/kubelet_dockershim_nodocker.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build dockerless -// +build dockerless - -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package kubelet - -import ( - "fmt" - kubeletconfiginternal "k8s.io/kubernetes/pkg/kubelet/apis/config" - "k8s.io/kubernetes/pkg/kubelet/config" -) - -func runDockershim(kubeCfg *kubeletconfiginternal.KubeletConfiguration, - kubeDeps *Dependencies, - crOptions *config.ContainerRuntimeOptions, - runtimeCgroups string, - remoteRuntimeEndpoint string, - remoteImageEndpoint string, - nonMasqueradeCIDR string) error { - - return fmt.Errorf("trying to use docker runtime when Kubelet was compiled without docker support") -} diff --git a/pkg/kubelet/legacy/logs.go b/pkg/kubelet/legacy/logs.go index d4b938a05c7..d0b6b8c2e10 100644 --- a/pkg/kubelet/legacy/logs.go +++ b/pkg/kubelet/legacy/logs.go @@ -29,17 +29,6 @@ import ( // It used to live in the `pkg/kubelet/dockershim` package. While we // would eventually like to remove it entirely, we need to give users some form // of warning. -// -// By including the interface in -// `pkg/kubelet/legacy/logs.go`, we ensure the interface is -// available to `pkg/kubelet`, even when we are building with the `dockerless` -// tag (i.e. not compiling the dockershim). -// While the interface always exists, there will be no implementations of the -// interface when building with the `dockerless` tag. The lack of -// implementations should not be an issue, as we only expect `pkg/kubelet` code -// to need an implementation of the `DockerLegacyService` when we are using -// docker. If we are using docker, but building with the `dockerless` tag, than -// this will be just one of many things that breaks. type DockerLegacyService interface { // GetContainerLogs gets logs for a specific container. GetContainerLogs(context.Context, *v1.Pod, kubecontainer.ContainerID, *v1.PodLogOptions, io.Writer, io.Writer) error