diff --git a/pkg/api/persistentvolumeclaim/BUILD b/pkg/api/persistentvolumeclaim/BUILD index fba0dfd659..3a72b78c8f 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 3ce0a93c8c..0000000000 --- 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 5721392c09..2da65ee0c5 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 4fb4521397..0000000000 --- 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 4d566715fb..92c5c73c67 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 f379a10cfb..0000000000 --- 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 4a29be29ae..f9a72f4ed1 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 ad488a1caa..0000000000 --- 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 b7e881dd95..e52a3e4f90 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 e46b01929f..0000000000 --- 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 a815e5b0ac..ed546217cf 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 ad488a1caa..0000000000 --- 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 0cddfad64b..1b37c7f631 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 6af02d0a11..0000000000 --- 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 11449ae5f1..05bd5565a7 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 e46b01929f..0000000000 --- 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 4695a2ddb2..7be3387015 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 4613d1156c..0000000000 --- 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 fec90d3adc..a91f11d93e 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 ad488a1caa..0000000000 --- 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 25e1c6fe6b..65171eaf32 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 a2abc54d01..0000000000 --- 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 34eba68811..1b5e1f7841 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 4fe1e9885c..0000000000 --- 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 0292ffce29..3a01add959 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 6af02d0a11..0000000000 --- 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 ae16c23f11..aac87f389d 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 490540aa60..0000000000 --- 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 fd5e6391c5..182e53517c 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 d3370f13cc..f8421a3977 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 f13d029c39..0000000000 --- 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 65968751a8..cf6b99ae6c 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 a5c470b3ed..0000000000 --- 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 361c348711..12c16e7e54 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 8507d04f37..0000000000 --- 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 f7ab8e1ca1..0000000000 --- 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 f7d550391f..00a63fef44 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 1ed5fa1543..0000000000 --- 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 d1a06818df..8fab53ffa8 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 2878db15c9..0000000000 --- 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 b0fceedbbb..cd0d4d8f44 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 928b112293..0000000000 --- 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 a41a69e0cf..f038b0d32e 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 de49504ed7..0000000000 --- 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 5350880448..ca88d62d7b 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 e89d5ca3ea..0000000000 --- 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 c3dc753d20..98e4bbc140 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 58ee7b487c..0653a92a7a 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 11bc537373..0000000000 --- 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 e8a08011f3..7f287117f5 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 8ca621ecd5..0000000000 --- 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 1e3a118c9f..c06cbd716e 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 73e322ffda..0000000000 --- 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 61202c8c28..f2273ee9ee 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 e29bc63f43..0000000000 --- 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 7644879e95..0000000000 --- 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 2bc3929fe0..597fd6597a 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 5322fcd7ed..0000000000 --- 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 64eac778de..ffd1d03215 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 6af02d0a11..0000000000 --- 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 b519bf07ee..20b854020c 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 d500cb63af..0000000000 --- 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 3737f0c236..97abdf9f9c 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 c17952fd3e..0000000000 --- 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 96d889890e..99c73f482f 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 a9d7da3043..0000000000 --- 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 35b7366258..d93e3e75c1 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 60a5d5020e..0000000000 --- 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 6073526d6b..712b6555d5 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 1c7d89390a..0000000000 --- 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 766a85a1d8..6b0a5fe8d3 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. //