From 2498ca760695ad03d4b400ab1e9766799f4d7975 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Wed, 21 Nov 2018 10:44:02 -0500 Subject: [PATCH] drop VerifyFeatureGatesUnchanged --- pkg/api/persistentvolumeclaim/BUILD | 5 +-- pkg/api/persistentvolumeclaim/main_test.go | 29 -------------- pkg/api/pod/BUILD | 5 +-- pkg/api/pod/main_test.go | 29 -------------- pkg/api/podsecuritypolicy/BUILD | 5 +-- pkg/api/podsecuritypolicy/main_test.go | 29 -------------- pkg/apis/batch/validation/BUILD | 5 +-- pkg/apis/batch/validation/main_test.go | 29 -------------- pkg/apis/core/v1/BUILD | 1 - pkg/apis/core/v1/main_test.go | 29 -------------- pkg/apis/core/validation/BUILD | 1 - pkg/apis/core/validation/main_test.go | 29 -------------- pkg/apis/storage/util/BUILD | 5 +-- pkg/apis/storage/util/main_test.go | 29 -------------- pkg/apis/storage/v1/BUILD | 5 +-- pkg/apis/storage/v1/main_test.go | 29 -------------- pkg/apis/storage/v1beta1/BUILD | 5 +-- pkg/apis/storage/v1beta1/main_test.go | 29 -------------- pkg/apis/storage/validation/BUILD | 5 +-- pkg/apis/storage/validation/main_test.go | 29 -------------- pkg/controller/cloud/BUILD | 1 - pkg/controller/cloud/main_test.go | 29 -------------- pkg/controller/daemon/BUILD | 1 - pkg/controller/daemon/main_test.go | 29 -------------- pkg/controller/daemon/util/BUILD | 5 +-- pkg/controller/daemon/util/main_test.go | 29 -------------- pkg/controller/volume/persistentvolume/BUILD | 1 - .../volume/persistentvolume/main_test.go | 29 -------------- pkg/kubelet/BUILD | 1 - pkg/kubelet/cadvisor/BUILD | 10 ++--- pkg/kubelet/cadvisor/main_test.go | 29 -------------- pkg/kubelet/eviction/BUILD | 1 - pkg/kubelet/eviction/main_test.go | 29 -------------- pkg/kubelet/kuberuntime/BUILD | 1 - pkg/kubelet/kuberuntime/main_test.go | 29 -------------- pkg/kubelet/main_test.go | 29 -------------- pkg/kubelet/network/dns/BUILD | 5 +-- pkg/kubelet/network/dns/main_test.go | 29 -------------- pkg/kubelet/preemption/BUILD | 5 +-- pkg/kubelet/preemption/main_test.go | 29 -------------- pkg/kubelet/types/BUILD | 1 - pkg/kubelet/types/main_test.go | 29 -------------- pkg/kubelet/volumemanager/populator/BUILD | 5 +-- .../volumemanager/populator/main_test.go | 29 -------------- pkg/kubelet/volumemanager/reconciler/BUILD | 5 +-- .../volumemanager/reconciler/main_test.go | 29 -------------- pkg/scheduler/BUILD | 5 +-- pkg/scheduler/algorithm/predicates/BUILD | 1 - .../algorithm/predicates/main_test.go | 29 -------------- pkg/scheduler/algorithm/priorities/BUILD | 1 - .../algorithm/priorities/main_test.go | 29 -------------- pkg/scheduler/algorithmprovider/BUILD | 5 +-- pkg/scheduler/algorithmprovider/main_test.go | 29 -------------- pkg/scheduler/internal/cache/BUILD | 1 - pkg/scheduler/internal/cache/main_test.go | 29 -------------- pkg/scheduler/main_test.go | 29 -------------- pkg/volume/csi/BUILD | 1 - pkg/volume/csi/main_test.go | 29 -------------- pkg/volume/util/BUILD | 1 - pkg/volume/util/main_test.go | 29 -------------- .../admission/podtolerationrestriction/BUILD | 5 +-- .../podtolerationrestriction/main_test.go | 29 -------------- plugin/pkg/admission/priority/BUILD | 5 +-- plugin/pkg/admission/priority/main_test.go | 29 -------------- plugin/pkg/admission/resourcequota/BUILD | 5 +-- .../pkg/admission/resourcequota/main_test.go | 29 -------------- .../storage/persistentvolume/label/BUILD | 5 +-- .../persistentvolume/label/main_test.go | 29 -------------- .../storageobjectinuseprotection/BUILD | 5 +-- .../storageobjectinuseprotection/main_test.go | 29 -------------- .../feature/testing/feature_gate_testing.go | 40 ------------------- 71 files changed, 24 insertions(+), 1155 deletions(-) delete mode 100644 pkg/api/persistentvolumeclaim/main_test.go delete mode 100644 pkg/api/pod/main_test.go delete mode 100644 pkg/api/podsecuritypolicy/main_test.go delete mode 100644 pkg/apis/batch/validation/main_test.go delete mode 100644 pkg/apis/core/v1/main_test.go delete mode 100644 pkg/apis/core/validation/main_test.go delete mode 100644 pkg/apis/storage/util/main_test.go delete mode 100644 pkg/apis/storage/v1/main_test.go delete mode 100644 pkg/apis/storage/v1beta1/main_test.go delete mode 100644 pkg/apis/storage/validation/main_test.go delete mode 100644 pkg/controller/cloud/main_test.go delete mode 100644 pkg/controller/daemon/main_test.go delete mode 100644 pkg/controller/daemon/util/main_test.go delete mode 100644 pkg/controller/volume/persistentvolume/main_test.go delete mode 100644 pkg/kubelet/cadvisor/main_test.go delete mode 100644 pkg/kubelet/eviction/main_test.go delete mode 100644 pkg/kubelet/kuberuntime/main_test.go delete mode 100644 pkg/kubelet/main_test.go delete mode 100644 pkg/kubelet/network/dns/main_test.go delete mode 100644 pkg/kubelet/preemption/main_test.go delete mode 100644 pkg/kubelet/types/main_test.go delete mode 100644 pkg/kubelet/volumemanager/populator/main_test.go delete mode 100644 pkg/kubelet/volumemanager/reconciler/main_test.go delete mode 100644 pkg/scheduler/algorithm/predicates/main_test.go delete mode 100644 pkg/scheduler/algorithm/priorities/main_test.go delete mode 100644 pkg/scheduler/algorithmprovider/main_test.go delete mode 100644 pkg/scheduler/internal/cache/main_test.go delete mode 100644 pkg/scheduler/main_test.go delete mode 100644 pkg/volume/csi/main_test.go delete mode 100644 pkg/volume/util/main_test.go delete mode 100644 plugin/pkg/admission/podtolerationrestriction/main_test.go delete mode 100644 plugin/pkg/admission/priority/main_test.go delete mode 100644 plugin/pkg/admission/resourcequota/main_test.go delete mode 100644 plugin/pkg/admission/storage/persistentvolume/label/main_test.go delete mode 100644 plugin/pkg/admission/storage/storageobjectinuseprotection/main_test.go diff --git a/pkg/api/persistentvolumeclaim/BUILD b/pkg/api/persistentvolumeclaim/BUILD index fba0dfd6598..3a72b78c8f0 100644 --- a/pkg/api/persistentvolumeclaim/BUILD +++ b/pkg/api/persistentvolumeclaim/BUILD @@ -32,10 +32,7 @@ filegroup( go_test( name = "go_default_test", - srcs = [ - "main_test.go", - "util_test.go", - ], + srcs = ["util_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/pkg/api/persistentvolumeclaim/main_test.go b/pkg/api/persistentvolumeclaim/main_test.go deleted file mode 100644 index 3ce0a93c8c1..00000000000 --- a/pkg/api/persistentvolumeclaim/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package persistentvolumeclaim - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/api/pod/BUILD b/pkg/api/pod/BUILD index 5721392c09a..2da65ee0c57 100644 --- a/pkg/api/pod/BUILD +++ b/pkg/api/pod/BUILD @@ -33,10 +33,7 @@ filegroup( go_test( name = "go_default_test", - srcs = [ - "main_test.go", - "util_test.go", - ], + srcs = ["util_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/pkg/api/pod/main_test.go b/pkg/api/pod/main_test.go deleted file mode 100644 index 4fb45213978..00000000000 --- a/pkg/api/pod/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package pod - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/api/podsecuritypolicy/BUILD b/pkg/api/podsecuritypolicy/BUILD index 4d566715fb7..92c5c73c67b 100644 --- a/pkg/api/podsecuritypolicy/BUILD +++ b/pkg/api/podsecuritypolicy/BUILD @@ -32,10 +32,7 @@ filegroup( go_test( name = "go_default_test", - srcs = [ - "main_test.go", - "util_test.go", - ], + srcs = ["util_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/pkg/api/podsecuritypolicy/main_test.go b/pkg/api/podsecuritypolicy/main_test.go deleted file mode 100644 index f379a10cfbe..00000000000 --- a/pkg/api/podsecuritypolicy/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package podsecuritypolicy - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/apis/batch/validation/BUILD b/pkg/apis/batch/validation/BUILD index 4a29be29ae2..f9a72f4ed17 100644 --- a/pkg/apis/batch/validation/BUILD +++ b/pkg/apis/batch/validation/BUILD @@ -27,10 +27,7 @@ go_library( go_test( name = "go_default_test", - srcs = [ - "main_test.go", - "validation_test.go", - ], + srcs = ["validation_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/batch:go_default_library", diff --git a/pkg/apis/batch/validation/main_test.go b/pkg/apis/batch/validation/main_test.go deleted file mode 100644 index ad488a1caaa..00000000000 --- a/pkg/apis/batch/validation/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package validation - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/apis/core/v1/BUILD b/pkg/apis/core/v1/BUILD index b7e881dd95c..e52a3e4f907 100644 --- a/pkg/apis/core/v1/BUILD +++ b/pkg/apis/core/v1/BUILD @@ -36,7 +36,6 @@ go_test( srcs = [ "conversion_test.go", "defaults_test.go", - "main_test.go", ], embed = [":go_default_library"], deps = [ diff --git a/pkg/apis/core/v1/main_test.go b/pkg/apis/core/v1/main_test.go deleted file mode 100644 index e46b01929f7..00000000000 --- a/pkg/apis/core/v1/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package v1 - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/apis/core/validation/BUILD b/pkg/apis/core/validation/BUILD index a815e5b0ac7..ed546217cf6 100644 --- a/pkg/apis/core/validation/BUILD +++ b/pkg/apis/core/validation/BUILD @@ -47,7 +47,6 @@ go_test( name = "go_default_test", srcs = [ "events_test.go", - "main_test.go", "validation_test.go", ], embed = [":go_default_library"], diff --git a/pkg/apis/core/validation/main_test.go b/pkg/apis/core/validation/main_test.go deleted file mode 100644 index ad488a1caaa..00000000000 --- a/pkg/apis/core/validation/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package validation - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/apis/storage/util/BUILD b/pkg/apis/storage/util/BUILD index 0cddfad64b4..1b37c7f631d 100644 --- a/pkg/apis/storage/util/BUILD +++ b/pkg/apis/storage/util/BUILD @@ -36,10 +36,7 @@ filegroup( go_test( name = "go_default_test", - srcs = [ - "main_test.go", - "util_test.go", - ], + srcs = ["util_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/pkg/apis/storage/util/main_test.go b/pkg/apis/storage/util/main_test.go deleted file mode 100644 index 6af02d0a11d..00000000000 --- a/pkg/apis/storage/util/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package util - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/apis/storage/v1/BUILD b/pkg/apis/storage/v1/BUILD index 11449ae5f12..05bd5565a79 100644 --- a/pkg/apis/storage/v1/BUILD +++ b/pkg/apis/storage/v1/BUILD @@ -47,10 +47,7 @@ filegroup( go_test( name = "go_default_test", - srcs = [ - "defaults_test.go", - "main_test.go", - ], + srcs = ["defaults_test.go"], embed = [":go_default_library"], deps = [ "//pkg/api/legacyscheme:go_default_library", diff --git a/pkg/apis/storage/v1/main_test.go b/pkg/apis/storage/v1/main_test.go deleted file mode 100644 index e46b01929f7..00000000000 --- a/pkg/apis/storage/v1/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package v1 - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/apis/storage/v1beta1/BUILD b/pkg/apis/storage/v1beta1/BUILD index 4695a2ddb21..7be33870151 100644 --- a/pkg/apis/storage/v1beta1/BUILD +++ b/pkg/apis/storage/v1beta1/BUILD @@ -47,10 +47,7 @@ filegroup( go_test( name = "go_default_test", - srcs = [ - "defaults_test.go", - "main_test.go", - ], + srcs = ["defaults_test.go"], embed = [":go_default_library"], deps = [ "//pkg/api/legacyscheme:go_default_library", diff --git a/pkg/apis/storage/v1beta1/main_test.go b/pkg/apis/storage/v1beta1/main_test.go deleted file mode 100644 index 4613d1156c4..00000000000 --- a/pkg/apis/storage/v1beta1/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package v1beta1 - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/apis/storage/validation/BUILD b/pkg/apis/storage/validation/BUILD index fec90d3adcb..a91f11d93e1 100644 --- a/pkg/apis/storage/validation/BUILD +++ b/pkg/apis/storage/validation/BUILD @@ -26,10 +26,7 @@ go_library( go_test( name = "go_default_test", - srcs = [ - "main_test.go", - "validation_test.go", - ], + srcs = ["validation_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/pkg/apis/storage/validation/main_test.go b/pkg/apis/storage/validation/main_test.go deleted file mode 100644 index ad488a1caaa..00000000000 --- a/pkg/apis/storage/validation/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package validation - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/controller/cloud/BUILD b/pkg/controller/cloud/BUILD index 25e1c6fe6bc..65171eaf32e 100644 --- a/pkg/controller/cloud/BUILD +++ b/pkg/controller/cloud/BUILD @@ -50,7 +50,6 @@ go_library( go_test( name = "go_default_test", srcs = [ - "main_test.go", "node_controller_test.go", "pvlcontroller_test.go", ], diff --git a/pkg/controller/cloud/main_test.go b/pkg/controller/cloud/main_test.go deleted file mode 100644 index a2abc54d015..00000000000 --- a/pkg/controller/cloud/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package cloud - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/controller/daemon/BUILD b/pkg/controller/daemon/BUILD index 34eba68811e..1b5e1f7841a 100644 --- a/pkg/controller/daemon/BUILD +++ b/pkg/controller/daemon/BUILD @@ -61,7 +61,6 @@ go_test( name = "go_default_test", srcs = [ "daemon_controller_test.go", - "main_test.go", "update_test.go", ], embed = [":go_default_library"], diff --git a/pkg/controller/daemon/main_test.go b/pkg/controller/daemon/main_test.go deleted file mode 100644 index 4fe1e9885c2..00000000000 --- a/pkg/controller/daemon/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package daemon - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/controller/daemon/util/BUILD b/pkg/controller/daemon/util/BUILD index 0292ffce296..3a01add9594 100644 --- a/pkg/controller/daemon/util/BUILD +++ b/pkg/controller/daemon/util/BUILD @@ -39,10 +39,7 @@ filegroup( go_test( name = "go_default_test", - srcs = [ - "daemonset_util_test.go", - "main_test.go", - ], + srcs = ["daemonset_util_test.go"], embed = [":go_default_library"], deps = [ "//pkg/api/testapi:go_default_library", diff --git a/pkg/controller/daemon/util/main_test.go b/pkg/controller/daemon/util/main_test.go deleted file mode 100644 index 6af02d0a11d..00000000000 --- a/pkg/controller/daemon/util/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package util - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/controller/volume/persistentvolume/BUILD b/pkg/controller/volume/persistentvolume/BUILD index ae16c23f113..aac87f389d9 100644 --- a/pkg/controller/volume/persistentvolume/BUILD +++ b/pkg/controller/volume/persistentvolume/BUILD @@ -70,7 +70,6 @@ go_test( "delete_test.go", "framework_test.go", "index_test.go", - "main_test.go", "provision_test.go", "pv_controller_test.go", "recycle_test.go", diff --git a/pkg/controller/volume/persistentvolume/main_test.go b/pkg/controller/volume/persistentvolume/main_test.go deleted file mode 100644 index 490540aa60b..00000000000 --- a/pkg/controller/volume/persistentvolume/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package persistentvolume - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/kubelet/BUILD b/pkg/kubelet/BUILD index fd5e6391c51..182e53517c9 100644 --- a/pkg/kubelet/BUILD +++ b/pkg/kubelet/BUILD @@ -166,7 +166,6 @@ go_test( "kubelet_resources_test.go", "kubelet_test.go", "kubelet_volumes_test.go", - "main_test.go", "oom_watcher_test.go", "pod_container_deletor_test.go", "pod_workers_test.go", diff --git a/pkg/kubelet/cadvisor/BUILD b/pkg/kubelet/cadvisor/BUILD index d3370f13cc8..f8421a3977c 100644 --- a/pkg/kubelet/cadvisor/BUILD +++ b/pkg/kubelet/cadvisor/BUILD @@ -50,19 +50,17 @@ go_test( name = "go_default_test", srcs = [ "cadvisor_linux_test.go", - "main_test.go", "util_test.go", ], embed = [":go_default_library"], - deps = [ - "//pkg/features:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/feature/testing:go_default_library", - ] + select({ + deps = select({ "@io_bazel_rules_go//go/platform:linux": [ "//pkg/apis/core/v1/helper:go_default_library", + "//pkg/features:go_default_library", "//pkg/kubelet/types:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library", + "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", + "//staging/src/k8s.io/apiserver/pkg/util/feature/testing:go_default_library", "//vendor/github.com/google/cadvisor/info/v1:go_default_library", "//vendor/github.com/google/cadvisor/metrics:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", diff --git a/pkg/kubelet/cadvisor/main_test.go b/pkg/kubelet/cadvisor/main_test.go deleted file mode 100644 index f13d029c393..00000000000 --- a/pkg/kubelet/cadvisor/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package cadvisor - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/kubelet/eviction/BUILD b/pkg/kubelet/eviction/BUILD index 65968751a8d..cf6b99ae6cc 100644 --- a/pkg/kubelet/eviction/BUILD +++ b/pkg/kubelet/eviction/BUILD @@ -11,7 +11,6 @@ go_test( srcs = [ "eviction_manager_test.go", "helpers_test.go", - "main_test.go", "memory_threshold_notifier_test.go", "mock_threshold_notifier_test.go", ], diff --git a/pkg/kubelet/eviction/main_test.go b/pkg/kubelet/eviction/main_test.go deleted file mode 100644 index a5c470b3ed5..00000000000 --- a/pkg/kubelet/eviction/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package eviction - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/kubelet/kuberuntime/BUILD b/pkg/kubelet/kuberuntime/BUILD index 361c3487115..12c16e7e548 100644 --- a/pkg/kubelet/kuberuntime/BUILD +++ b/pkg/kubelet/kuberuntime/BUILD @@ -95,7 +95,6 @@ go_test( "kuberuntime_sandbox_test.go", "labels_test.go", "legacy_test.go", - "main_test.go", "security_context_test.go", ], embed = [":go_default_library"], diff --git a/pkg/kubelet/kuberuntime/main_test.go b/pkg/kubelet/kuberuntime/main_test.go deleted file mode 100644 index 8507d04f373..00000000000 --- a/pkg/kubelet/kuberuntime/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package kuberuntime - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/kubelet/main_test.go b/pkg/kubelet/main_test.go deleted file mode 100644 index f7ab8e1ca1f..00000000000 --- a/pkg/kubelet/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package kubelet - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/kubelet/network/dns/BUILD b/pkg/kubelet/network/dns/BUILD index f7d550391f3..00a63fef44f 100644 --- a/pkg/kubelet/network/dns/BUILD +++ b/pkg/kubelet/network/dns/BUILD @@ -21,10 +21,7 @@ go_library( go_test( name = "go_default_test", - srcs = [ - "dns_test.go", - "main_test.go", - ], + srcs = ["dns_test.go"], embed = [":go_default_library"], deps = [ "//pkg/features:go_default_library", diff --git a/pkg/kubelet/network/dns/main_test.go b/pkg/kubelet/network/dns/main_test.go deleted file mode 100644 index 1ed5fa15436..00000000000 --- a/pkg/kubelet/network/dns/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package dns - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/kubelet/preemption/BUILD b/pkg/kubelet/preemption/BUILD index d1a06818df3..8fab53ffa81 100644 --- a/pkg/kubelet/preemption/BUILD +++ b/pkg/kubelet/preemption/BUILD @@ -41,10 +41,7 @@ filegroup( go_test( name = "go_default_test", - srcs = [ - "main_test.go", - "preemption_test.go", - ], + srcs = ["preemption_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/pkg/kubelet/preemption/main_test.go b/pkg/kubelet/preemption/main_test.go deleted file mode 100644 index 2878db15c9b..00000000000 --- a/pkg/kubelet/preemption/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package preemption - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/kubelet/types/BUILD b/pkg/kubelet/types/BUILD index b0fceedbbbd..cd0d4d8f448 100644 --- a/pkg/kubelet/types/BUILD +++ b/pkg/kubelet/types/BUILD @@ -32,7 +32,6 @@ go_test( name = "go_default_test", srcs = [ "labels_test.go", - "main_test.go", "pod_status_test.go", "pod_update_test.go", "types_test.go", diff --git a/pkg/kubelet/types/main_test.go b/pkg/kubelet/types/main_test.go deleted file mode 100644 index 928b1122930..00000000000 --- a/pkg/kubelet/types/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package types - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/kubelet/volumemanager/populator/BUILD b/pkg/kubelet/volumemanager/populator/BUILD index a41a69e0cf5..f038b0d32e6 100644 --- a/pkg/kubelet/volumemanager/populator/BUILD +++ b/pkg/kubelet/volumemanager/populator/BUILD @@ -47,10 +47,7 @@ filegroup( go_test( name = "go_default_test", - srcs = [ - "desired_state_of_world_populator_test.go", - "main_test.go", - ], + srcs = ["desired_state_of_world_populator_test.go"], embed = [":go_default_library"], deps = [ "//pkg/features:go_default_library", diff --git a/pkg/kubelet/volumemanager/populator/main_test.go b/pkg/kubelet/volumemanager/populator/main_test.go deleted file mode 100644 index de49504ed70..00000000000 --- a/pkg/kubelet/volumemanager/populator/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package populator - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/kubelet/volumemanager/reconciler/BUILD b/pkg/kubelet/volumemanager/reconciler/BUILD index 53508804484..ca88d62d7b9 100644 --- a/pkg/kubelet/volumemanager/reconciler/BUILD +++ b/pkg/kubelet/volumemanager/reconciler/BUILD @@ -35,10 +35,7 @@ go_library( go_test( name = "go_default_test", - srcs = [ - "main_test.go", - "reconciler_test.go", - ], + srcs = ["reconciler_test.go"], embed = [":go_default_library"], deps = [ "//pkg/features:go_default_library", diff --git a/pkg/kubelet/volumemanager/reconciler/main_test.go b/pkg/kubelet/volumemanager/reconciler/main_test.go deleted file mode 100644 index e89d5ca3ea0..00000000000 --- a/pkg/kubelet/volumemanager/reconciler/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package reconciler - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/scheduler/BUILD b/pkg/scheduler/BUILD index c3dc753d20d..98e4bbc140d 100644 --- a/pkg/scheduler/BUILD +++ b/pkg/scheduler/BUILD @@ -40,10 +40,7 @@ go_library( go_test( name = "go_default_test", - srcs = [ - "main_test.go", - "scheduler_test.go", - ], + srcs = ["scheduler_test.go"], embed = [":go_default_library"], deps = [ "//pkg/api/legacyscheme:go_default_library", diff --git a/pkg/scheduler/algorithm/predicates/BUILD b/pkg/scheduler/algorithm/predicates/BUILD index 58ee7b487cc..0653a92a7af 100644 --- a/pkg/scheduler/algorithm/predicates/BUILD +++ b/pkg/scheduler/algorithm/predicates/BUILD @@ -49,7 +49,6 @@ go_test( name = "go_default_test", srcs = [ "csi_volume_predicate_test.go", - "main_test.go", "max_attachable_volume_predicate_test.go", "metadata_test.go", "predicates_test.go", diff --git a/pkg/scheduler/algorithm/predicates/main_test.go b/pkg/scheduler/algorithm/predicates/main_test.go deleted file mode 100644 index 11bc537373b..00000000000 --- a/pkg/scheduler/algorithm/predicates/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package predicates - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/scheduler/algorithm/priorities/BUILD b/pkg/scheduler/algorithm/priorities/BUILD index e8a08011f35..7f287117f5e 100644 --- a/pkg/scheduler/algorithm/priorities/BUILD +++ b/pkg/scheduler/algorithm/priorities/BUILD @@ -55,7 +55,6 @@ go_test( "image_locality_test.go", "interpod_affinity_test.go", "least_requested_test.go", - "main_test.go", "metadata_test.go", "most_requested_test.go", "node_affinity_test.go", diff --git a/pkg/scheduler/algorithm/priorities/main_test.go b/pkg/scheduler/algorithm/priorities/main_test.go deleted file mode 100644 index 8ca621ecd52..00000000000 --- a/pkg/scheduler/algorithm/priorities/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package priorities - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/scheduler/algorithmprovider/BUILD b/pkg/scheduler/algorithmprovider/BUILD index 1e3a118c9f2..c06cbd716e4 100644 --- a/pkg/scheduler/algorithmprovider/BUILD +++ b/pkg/scheduler/algorithmprovider/BUILD @@ -15,10 +15,7 @@ go_library( go_test( name = "go_default_test", - srcs = [ - "main_test.go", - "plugins_test.go", - ], + srcs = ["plugins_test.go"], embed = [":go_default_library"], deps = [ "//pkg/features:go_default_library", diff --git a/pkg/scheduler/algorithmprovider/main_test.go b/pkg/scheduler/algorithmprovider/main_test.go deleted file mode 100644 index 73e322ffdac..00000000000 --- a/pkg/scheduler/algorithmprovider/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package algorithmprovider - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/scheduler/internal/cache/BUILD b/pkg/scheduler/internal/cache/BUILD index 61202c8c286..f2273ee9ee3 100644 --- a/pkg/scheduler/internal/cache/BUILD +++ b/pkg/scheduler/internal/cache/BUILD @@ -26,7 +26,6 @@ go_test( name = "go_default_test", srcs = [ "cache_test.go", - "main_test.go", "node_tree_test.go", ], embed = [":go_default_library"], diff --git a/pkg/scheduler/internal/cache/main_test.go b/pkg/scheduler/internal/cache/main_test.go deleted file mode 100644 index e29bc63f43a..00000000000 --- a/pkg/scheduler/internal/cache/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package cache - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/scheduler/main_test.go b/pkg/scheduler/main_test.go deleted file mode 100644 index 7644879e952..00000000000 --- a/pkg/scheduler/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package scheduler - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/volume/csi/BUILD b/pkg/volume/csi/BUILD index 2bc3929fe0f..597fd6597a2 100644 --- a/pkg/volume/csi/BUILD +++ b/pkg/volume/csi/BUILD @@ -44,7 +44,6 @@ go_test( "csi_client_test.go", "csi_mounter_test.go", "csi_plugin_test.go", - "main_test.go", ], embed = [":go_default_library"], deps = [ diff --git a/pkg/volume/csi/main_test.go b/pkg/volume/csi/main_test.go deleted file mode 100644 index 5322fcd7edc..00000000000 --- a/pkg/volume/csi/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package csi - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/pkg/volume/util/BUILD b/pkg/volume/util/BUILD index 64eac778de2..ffd1d032151 100644 --- a/pkg/volume/util/BUILD +++ b/pkg/volume/util/BUILD @@ -52,7 +52,6 @@ go_test( "atomic_writer_test.go", "attach_limit_test.go", "device_util_linux_test.go", - "main_test.go", "nested_volumes_test.go", "resize_util_test.go", "util_test.go", diff --git a/pkg/volume/util/main_test.go b/pkg/volume/util/main_test.go deleted file mode 100644 index 6af02d0a11d..00000000000 --- a/pkg/volume/util/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package util - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/plugin/pkg/admission/podtolerationrestriction/BUILD b/plugin/pkg/admission/podtolerationrestriction/BUILD index b519bf07ee7..20b854020c7 100644 --- a/plugin/pkg/admission/podtolerationrestriction/BUILD +++ b/plugin/pkg/admission/podtolerationrestriction/BUILD @@ -8,10 +8,7 @@ load( go_test( name = "go_default_test", - srcs = [ - "admission_test.go", - "main_test.go", - ], + srcs = ["admission_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/plugin/pkg/admission/podtolerationrestriction/main_test.go b/plugin/pkg/admission/podtolerationrestriction/main_test.go deleted file mode 100644 index d500cb63af7..00000000000 --- a/plugin/pkg/admission/podtolerationrestriction/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package podtolerationrestriction - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/plugin/pkg/admission/priority/BUILD b/plugin/pkg/admission/priority/BUILD index 3737f0c2361..97abdf9f9c7 100644 --- a/plugin/pkg/admission/priority/BUILD +++ b/plugin/pkg/admission/priority/BUILD @@ -8,10 +8,7 @@ load( go_test( name = "go_default_test", - srcs = [ - "admission_test.go", - "main_test.go", - ], + srcs = ["admission_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/plugin/pkg/admission/priority/main_test.go b/plugin/pkg/admission/priority/main_test.go deleted file mode 100644 index c17952fd3eb..00000000000 --- a/plugin/pkg/admission/priority/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package priority - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/plugin/pkg/admission/resourcequota/BUILD b/plugin/pkg/admission/resourcequota/BUILD index 96d889890e1..99c73f482fc 100644 --- a/plugin/pkg/admission/resourcequota/BUILD +++ b/plugin/pkg/admission/resourcequota/BUILD @@ -51,10 +51,7 @@ go_library( go_test( name = "go_default_test", - srcs = [ - "admission_test.go", - "main_test.go", - ], + srcs = ["admission_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/plugin/pkg/admission/resourcequota/main_test.go b/plugin/pkg/admission/resourcequota/main_test.go deleted file mode 100644 index a9d7da30438..00000000000 --- a/plugin/pkg/admission/resourcequota/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package resourcequota - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/plugin/pkg/admission/storage/persistentvolume/label/BUILD b/plugin/pkg/admission/storage/persistentvolume/label/BUILD index 35b7366258d..d93e3e75c1f 100644 --- a/plugin/pkg/admission/storage/persistentvolume/label/BUILD +++ b/plugin/pkg/admission/storage/persistentvolume/label/BUILD @@ -32,10 +32,7 @@ go_library( go_test( name = "go_default_test", - srcs = [ - "admission_test.go", - "main_test.go", - ], + srcs = ["admission_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/plugin/pkg/admission/storage/persistentvolume/label/main_test.go b/plugin/pkg/admission/storage/persistentvolume/label/main_test.go deleted file mode 100644 index 60a5d5020e5..00000000000 --- a/plugin/pkg/admission/storage/persistentvolume/label/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package label - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/plugin/pkg/admission/storage/storageobjectinuseprotection/BUILD b/plugin/pkg/admission/storage/storageobjectinuseprotection/BUILD index 6073526d6bc..712b6555d56 100644 --- a/plugin/pkg/admission/storage/storageobjectinuseprotection/BUILD +++ b/plugin/pkg/admission/storage/storageobjectinuseprotection/BUILD @@ -17,10 +17,7 @@ go_library( go_test( name = "go_default_test", - srcs = [ - "admission_test.go", - "main_test.go", - ], + srcs = ["admission_test.go"], embed = [":go_default_library"], deps = [ "//pkg/apis/core:go_default_library", diff --git a/plugin/pkg/admission/storage/storageobjectinuseprotection/main_test.go b/plugin/pkg/admission/storage/storageobjectinuseprotection/main_test.go deleted file mode 100644 index 1c7d89390a1..00000000000 --- a/plugin/pkg/admission/storage/storageobjectinuseprotection/main_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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. -*/ - -package storageobjectinuseprotection - -import ( - "testing" - - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" - _ "k8s.io/kubernetes/pkg/features" -) - -func TestMain(m *testing.M) { - utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -} diff --git a/staging/src/k8s.io/apiserver/pkg/util/feature/testing/feature_gate_testing.go b/staging/src/k8s.io/apiserver/pkg/util/feature/testing/feature_gate_testing.go index 766a85a1d84..6b0a5fe8d3c 100644 --- a/staging/src/k8s.io/apiserver/pkg/util/feature/testing/feature_gate_testing.go +++ b/staging/src/k8s.io/apiserver/pkg/util/feature/testing/feature_gate_testing.go @@ -18,51 +18,11 @@ package testing import ( "fmt" - "os" - "strings" "testing" "k8s.io/apiserver/pkg/util/feature" ) -// VerifyFeatureGatesUnchanged ensures the provided gate does not change any values when tests() are completed. -// Intended to be placed into unit test packages that mess with feature gates. -// -// Example use: -// -// import ( -// "testing" -// -// utilfeature "k8s.io/apiserver/pkg/util/feature" -// utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" -// _ "k8s.io/kubernetes/pkg/features" -// ) -// -// func TestMain(m *testing.M) { -// utilfeaturetesting.VerifyFeatureGatesUnchanged(utilfeature.DefaultFeatureGate, m.Run) -// } -func VerifyFeatureGatesUnchanged(gate feature.FeatureGate, tests func() int) { - originalGates := gate.DeepCopy() - originalSet := fmt.Sprint(gate) - - rc := tests() - - finalSet := fmt.Sprint(gate) - if finalSet != originalSet { - for _, kv := range strings.Split(finalSet, ",") { - k := strings.Split(kv, "=")[0] - if originalGates.Enabled(feature.Feature(k)) != gate.Enabled(feature.Feature(k)) { - fmt.Println(fmt.Sprintf("VerifyFeatureGatesUnchanged: mutated %s feature gate from %v to %v", k, originalGates.Enabled(feature.Feature(k)), gate.Enabled(feature.Feature(k)))) - rc = 1 - } - } - } - - if rc != 0 { - os.Exit(rc) - } -} - // SetFeatureGateDuringTest sets the specified gate to the specified value, and returns a function that restores the original value. // Failures to set or restore cause the test to fail. //