From e2917bf06435c7911bb000a9a83efe1f9aef112c Mon Sep 17 00:00:00 2001 From: Carlos Panato Date: Fri, 6 Mar 2020 17:40:57 +0100 Subject: [PATCH] tests: standardize gomega/ginkgo imports --- api/v1alpha2/conversion_test.go | 1 + api/v1alpha3/cluster_webhook_test.go | 1 + api/v1alpha3/machine_webhook_test.go | 1 + api/v1alpha3/machinedeployment_webhook_test.go | 1 + api/v1alpha3/machinehealthcheck_webhook_test.go | 1 + api/v1alpha3/machineset_webhook_test.go | 1 + bootstrap/kubeadm/api/v1alpha2/conversion_test.go | 1 + .../v1alpha2/kubeadmbootstrapconfig_types_test.go | 1 + .../v1alpha3/kubeadmbootstrapconfig_types_test.go | 1 + .../kubeadmconfig_controller_reconciler_test.go | 1 + bootstrap/kubeadm/controllers/suite_test.go | 1 + bootstrap/util/configowner_test.go | 1 + cmd/clusterctl/test/e2e/config_cluster_test.go | 2 +- controllers/cluster_controller_phases_test.go | 1 + controllers/cluster_controller_test.go | 3 ++- controllers/external/util_test.go | 1 + controllers/machine_controller_noderef_test.go | 1 + controllers/machine_controller_phases_test.go | 1 + controllers/machine_controller_test.go | 1 + controllers/machine_helpers_test.go | 1 + controllers/machinedeployment_controller_test.go | 1 + controllers/machinehealthcheck_controller_test.go | 1 + controllers/machinehealthcheck_targets_test.go | 1 + controllers/machineset_controller_test.go | 1 + controllers/machineset_delete_policy_test.go | 2 +- controllers/remote/cluster_test.go | 1 + controllers/suite_test.go | 1 + controllers/suite_util_test.go | 1 + .../v1alpha3/kubeadm_control_plane_webhook_test.go | 1 + .../kubeadm_control_plane_controller_test.go | 1 + .../kubeadm/internal/failure_domain_test.go | 1 + .../kubeadm/internal/kubeadm_config_map_test.go | 1 + .../kubeadm/internal/machine_filters_test.go | 1 + exp/api/v1alpha3/machinepool_webhook_test.go | 1 + .../machinepool_controller_noderef_test.go | 1 + .../machinepool_controller_phases_test.go | 1 + exp/controllers/machinepool_controller_test.go | 1 + exp/controllers/suite_test.go | 1 + test/framework/apply.go | 1 + test/framework/config_test.go | 12 ++++++------ test/framework/control_plane.go | 1 + test/framework/convenience.go | 1 + test/framework/deprecated.go | 1 + test/framework/failure_domains.go | 1 + test/framework/management_cluster.go | 1 + test/helpers/components/common.go | 7 ++++--- test/helpers/kind/setup.go | 13 +++++++------ test/helpers/scheme/scheme.go | 1 + test/infrastructure/docker/e2e/custom_assertions.go | 1 + test/infrastructure/docker/e2e/docker_suite_test.go | 4 ++-- test/integration/cluster/cluster_test.go | 1 + util/conversion/conversion.go | 1 + util/conversion/conversion_test.go | 1 + util/kubeconfig/kubeconfig_test.go | 1 + util/patch/patch_test.go | 1 + util/util_test.go | 1 + 56 files changed, 72 insertions(+), 20 deletions(-) diff --git a/api/v1alpha2/conversion_test.go b/api/v1alpha2/conversion_test.go index 7a2e85d025ba..2780d0f15040 100644 --- a/api/v1alpha2/conversion_test.go +++ b/api/v1alpha2/conversion_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/api/v1alpha3/cluster_webhook_test.go b/api/v1alpha3/cluster_webhook_test.go index 83d3883831f3..a6b3e13fbc85 100644 --- a/api/v1alpha3/cluster_webhook_test.go +++ b/api/v1alpha3/cluster_webhook_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/api/v1alpha3/machine_webhook_test.go b/api/v1alpha3/machine_webhook_test.go index 631c75248e07..f2323f0fdb2c 100644 --- a/api/v1alpha3/machine_webhook_test.go +++ b/api/v1alpha3/machine_webhook_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" diff --git a/api/v1alpha3/machinedeployment_webhook_test.go b/api/v1alpha3/machinedeployment_webhook_test.go index d3f7973fd5f8..ae23ec5ed5a5 100644 --- a/api/v1alpha3/machinedeployment_webhook_test.go +++ b/api/v1alpha3/machinedeployment_webhook_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" ) diff --git a/api/v1alpha3/machinehealthcheck_webhook_test.go b/api/v1alpha3/machinehealthcheck_webhook_test.go index 975a82e1c02f..83eda0aeca0d 100644 --- a/api/v1alpha3/machinehealthcheck_webhook_test.go +++ b/api/v1alpha3/machinehealthcheck_webhook_test.go @@ -21,6 +21,7 @@ import ( "time" . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" ) diff --git a/api/v1alpha3/machineset_webhook_test.go b/api/v1alpha3/machineset_webhook_test.go index 55158bcda88f..a525adc3c1d0 100644 --- a/api/v1alpha3/machineset_webhook_test.go +++ b/api/v1alpha3/machineset_webhook_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" ) diff --git a/bootstrap/kubeadm/api/v1alpha2/conversion_test.go b/bootstrap/kubeadm/api/v1alpha2/conversion_test.go index 8b09a92d88c7..a39e0b7b8d8c 100644 --- a/bootstrap/kubeadm/api/v1alpha2/conversion_test.go +++ b/bootstrap/kubeadm/api/v1alpha2/conversion_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha3" diff --git a/bootstrap/kubeadm/api/v1alpha2/kubeadmbootstrapconfig_types_test.go b/bootstrap/kubeadm/api/v1alpha2/kubeadmbootstrapconfig_types_test.go index 2d117a9d3f8c..47915b61bdb3 100644 --- a/bootstrap/kubeadm/api/v1alpha2/kubeadmbootstrapconfig_types_test.go +++ b/bootstrap/kubeadm/api/v1alpha2/kubeadmbootstrapconfig_types_test.go @@ -19,6 +19,7 @@ package v1alpha2 import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "golang.org/x/net/context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/bootstrap/kubeadm/api/v1alpha3/kubeadmbootstrapconfig_types_test.go b/bootstrap/kubeadm/api/v1alpha3/kubeadmbootstrapconfig_types_test.go index 637556172205..2fa9d415f902 100644 --- a/bootstrap/kubeadm/api/v1alpha3/kubeadmbootstrapconfig_types_test.go +++ b/bootstrap/kubeadm/api/v1alpha3/kubeadmbootstrapconfig_types_test.go @@ -19,6 +19,7 @@ package v1alpha3 import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "golang.org/x/net/context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/bootstrap/kubeadm/controllers/kubeadmconfig_controller_reconciler_test.go b/bootstrap/kubeadm/controllers/kubeadmconfig_controller_reconciler_test.go index fa14ce0a5666..0effbfa0081e 100644 --- a/bootstrap/kubeadm/controllers/kubeadmconfig_controller_reconciler_test.go +++ b/bootstrap/kubeadm/controllers/kubeadmconfig_controller_reconciler_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/bootstrap/kubeadm/controllers/suite_test.go b/bootstrap/kubeadm/controllers/suite_test.go index 10dacbc3a821..eb4919e3c015 100644 --- a/bootstrap/kubeadm/controllers/suite_test.go +++ b/bootstrap/kubeadm/controllers/suite_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "k8s.io/client-go/kubernetes/scheme" "k8s.io/klog" "k8s.io/klog/klogr" diff --git a/bootstrap/util/configowner_test.go b/bootstrap/util/configowner_test.go index 930fcdac0001..6e1d8541b411 100644 --- a/bootstrap/util/configowner_test.go +++ b/bootstrap/util/configowner_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" diff --git a/cmd/clusterctl/test/e2e/config_cluster_test.go b/cmd/clusterctl/test/e2e/config_cluster_test.go index 2e410dccff7e..98834800cceb 100644 --- a/cmd/clusterctl/test/e2e/config_cluster_test.go +++ b/cmd/clusterctl/test/e2e/config_cluster_test.go @@ -25,8 +25,8 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/pkg/errors" + "github.com/pkg/errors" v1 "k8s.io/api/core/v1" "sigs.k8s.io/kind/pkg/cluster" ) diff --git a/controllers/cluster_controller_phases_test.go b/controllers/cluster_controller_phases_test.go index 2bf4b5c0dcda..a676a111696b 100644 --- a/controllers/cluster_controller_phases_test.go +++ b/controllers/cluster_controller_phases_test.go @@ -22,6 +22,7 @@ import ( "time" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/cluster_controller_test.go b/controllers/cluster_controller_test.go index 630450a57ff3..ca25d3302a35 100644 --- a/controllers/cluster_controller_test.go +++ b/controllers/cluster_controller_test.go @@ -20,9 +20,10 @@ import ( "context" "testing" - "github.com/gogo/protobuf/proto" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + + "github.com/gogo/protobuf/proto" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/external/util_test.go b/controllers/external/util_test.go index 02d8251ce076..955da4ff7e65 100644 --- a/controllers/external/util_test.go +++ b/controllers/external/util_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/controllers/machine_controller_noderef_test.go b/controllers/machine_controller_noderef_test.go index e3829a774544..ddd838471889 100644 --- a/controllers/machine_controller_noderef_test.go +++ b/controllers/machine_controller_noderef_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/controllers/machine_controller_phases_test.go b/controllers/machine_controller_phases_test.go index a9cc41b2ccfd..42c7c855480f 100644 --- a/controllers/machine_controller_phases_test.go +++ b/controllers/machine_controller_phases_test.go @@ -23,6 +23,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + dto "github.com/prometheus/client_model/go" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/machine_controller_test.go b/controllers/machine_controller_test.go index ca7bcfd8cbbb..ee1ac101f5d0 100644 --- a/controllers/machine_controller_test.go +++ b/controllers/machine_controller_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/controllers/machine_helpers_test.go b/controllers/machine_helpers_test.go index ebf310914ba8..4ec8e56ac356 100644 --- a/controllers/machine_helpers_test.go +++ b/controllers/machine_helpers_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/machinedeployment_controller_test.go b/controllers/machinedeployment_controller_test.go index d63cf4046595..b73458c0796a 100644 --- a/controllers/machinedeployment_controller_test.go +++ b/controllers/machinedeployment_controller_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/controllers/machinehealthcheck_controller_test.go b/controllers/machinehealthcheck_controller_test.go index 48f532da52b9..211c2ed77208 100644 --- a/controllers/machinehealthcheck_controller_test.go +++ b/controllers/machinehealthcheck_controller_test.go @@ -24,6 +24,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/gomega" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/controllers/machinehealthcheck_targets_test.go b/controllers/machinehealthcheck_targets_test.go index 0ce8bbb39fdf..e99f951c9eed 100644 --- a/controllers/machinehealthcheck_targets_test.go +++ b/controllers/machinehealthcheck_targets_test.go @@ -24,6 +24,7 @@ import ( . "github.com/onsi/gomega" gtypes "github.com/onsi/gomega/types" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/machineset_controller_test.go b/controllers/machineset_controller_test.go index 96cdf8219bf4..f66e3339ce51 100644 --- a/controllers/machineset_controller_test.go +++ b/controllers/machineset_controller_test.go @@ -23,6 +23,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/machineset_delete_policy_test.go b/controllers/machineset_delete_policy_test.go index 3d011a629c9f..ecdd9cd9dfd5 100644 --- a/controllers/machineset_delete_policy_test.go +++ b/controllers/machineset_delete_policy_test.go @@ -20,8 +20,8 @@ import ( "testing" . "github.com/onsi/gomega" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/controllers/remote/cluster_test.go b/controllers/remote/cluster_test.go index 30d06899162c..496dd4d3d012 100644 --- a/controllers/remote/cluster_test.go +++ b/controllers/remote/cluster_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 35c0d708b50a..195ac1e778a1 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -24,6 +24,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" diff --git a/controllers/suite_util_test.go b/controllers/suite_util_test.go index 0a28af6dff46..a02c24abe2bd 100644 --- a/controllers/suite_util_test.go +++ b/controllers/suite_util_test.go @@ -18,6 +18,7 @@ package controllers import ( . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook_test.go b/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook_test.go index 59bc82588036..1634936ad9f0 100644 --- a/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook_test.go +++ b/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook_test.go @@ -21,6 +21,7 @@ import ( "time" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" diff --git a/controlplane/kubeadm/controllers/kubeadm_control_plane_controller_test.go b/controlplane/kubeadm/controllers/kubeadm_control_plane_controller_test.go index f9ce865c1a55..eb9839baaf05 100644 --- a/controlplane/kubeadm/controllers/kubeadm_control_plane_controller_test.go +++ b/controlplane/kubeadm/controllers/kubeadm_control_plane_controller_test.go @@ -23,6 +23,7 @@ import ( "time" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/controlplane/kubeadm/internal/failure_domain_test.go b/controlplane/kubeadm/internal/failure_domain_test.go index 359423bb8f82..c93c2ba1d79f 100644 --- a/controlplane/kubeadm/internal/failure_domain_test.go +++ b/controlplane/kubeadm/internal/failure_domain_test.go @@ -20,6 +20,7 @@ import ( "testing" "github.com/onsi/gomega" + "k8s.io/utils/pointer" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" diff --git a/controlplane/kubeadm/internal/kubeadm_config_map_test.go b/controlplane/kubeadm/internal/kubeadm_config_map_test.go index 1764305d066f..3a81a5e70451 100644 --- a/controlplane/kubeadm/internal/kubeadm_config_map_test.go +++ b/controlplane/kubeadm/internal/kubeadm_config_map_test.go @@ -20,6 +20,7 @@ import ( "testing" "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" "sigs.k8s.io/yaml" ) diff --git a/controlplane/kubeadm/internal/machine_filters_test.go b/controlplane/kubeadm/internal/machine_filters_test.go index 832fa10e6b66..0c6200654914 100644 --- a/controlplane/kubeadm/internal/machine_filters_test.go +++ b/controlplane/kubeadm/internal/machine_filters_test.go @@ -21,6 +21,7 @@ import ( "time" "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" diff --git a/exp/api/v1alpha3/machinepool_webhook_test.go b/exp/api/v1alpha3/machinepool_webhook_test.go index 35b2fddc3347..df806c5aa66f 100644 --- a/exp/api/v1alpha3/machinepool_webhook_test.go +++ b/exp/api/v1alpha3/machinepool_webhook_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" diff --git a/exp/controllers/machinepool_controller_noderef_test.go b/exp/controllers/machinepool_controller_noderef_test.go index 5515644f76c7..50b9f017b346 100644 --- a/exp/controllers/machinepool_controller_noderef_test.go +++ b/exp/controllers/machinepool_controller_noderef_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/exp/controllers/machinepool_controller_phases_test.go b/exp/controllers/machinepool_controller_phases_test.go index 92a17f5659ee..1f11bc0bf94b 100644 --- a/exp/controllers/machinepool_controller_phases_test.go +++ b/exp/controllers/machinepool_controller_phases_test.go @@ -23,6 +23,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/exp/controllers/machinepool_controller_test.go b/exp/controllers/machinepool_controller_test.go index 31b27040208c..26ed9bd16d74 100644 --- a/exp/controllers/machinepool_controller_test.go +++ b/exp/controllers/machinepool_controller_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/exp/controllers/suite_test.go b/exp/controllers/suite_test.go index d90d1e1dfac3..85ee2dfcd32f 100644 --- a/exp/controllers/suite_test.go +++ b/exp/controllers/suite_test.go @@ -24,6 +24,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" diff --git a/test/framework/apply.go b/test/framework/apply.go index 63f04ee44b27..d908a72f554d 100644 --- a/test/framework/apply.go +++ b/test/framework/apply.go @@ -25,6 +25,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" diff --git a/test/framework/config_test.go b/test/framework/config_test.go index 486f955bbff8..4f4447f8fea0 100644 --- a/test/framework/config_test.go +++ b/test/framework/config_test.go @@ -19,17 +19,17 @@ package framework_test import ( "testing" - "github.com/onsi/gomega" + . "github.com/onsi/gomega" "sigs.k8s.io/cluster-api/test/framework" ) func TestMustDefaultConfig(t *testing.T) { - g := gomega.NewWithT(t) + g := NewWithT(t) config := framework.MustDefaultConfig() config.Defaults() - g.Expect(config.Validate()).To(gomega.Succeed()) - g.Expect(config.Components).To(gomega.HaveLen(4)) - g.Expect(config.Components[0].Waiters).To(gomega.HaveLen(2)) - g.Expect(config.Components[0].Waiters[1].Type).To(gomega.Equal(framework.PodsWaiter)) + g.Expect(config.Validate()).To(Succeed()) + g.Expect(config.Components).To(HaveLen(4)) + g.Expect(config.Components[0].Waiters).To(HaveLen(2)) + g.Expect(config.Components[0].Waiters[1].Type).To(Equal(framework.PodsWaiter)) } diff --git a/test/framework/control_plane.go b/test/framework/control_plane.go index d355a817c6bb..1d88b979a3a4 100644 --- a/test/framework/control_plane.go +++ b/test/framework/control_plane.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/test/framework/convenience.go b/test/framework/convenience.go index e36b68b1a2fa..eaed509fab0e 100644 --- a/test/framework/convenience.go +++ b/test/framework/convenience.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" diff --git a/test/framework/deprecated.go b/test/framework/deprecated.go index a129d0c7a2ea..84482aaadbfd 100644 --- a/test/framework/deprecated.go +++ b/test/framework/deprecated.go @@ -23,6 +23,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/pkg/errors" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" diff --git a/test/framework/failure_domains.go b/test/framework/failure_domains.go index 00b1efea1d05..60b571b92abc 100644 --- a/test/framework/failure_domains.go +++ b/test/framework/failure_domains.go @@ -20,6 +20,7 @@ import ( "context" . "github.com/onsi/gomega" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/framework/management_cluster.go b/test/framework/management_cluster.go index 754161de5fe8..64a8c3b3b9f7 100644 --- a/test/framework/management_cluster.go +++ b/test/framework/management_cluster.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/cluster-api/test/framework/management/kind" ) diff --git a/test/helpers/components/common.go b/test/helpers/components/common.go index 39f8305bbb7b..54cb5cc69a6a 100644 --- a/test/helpers/components/common.go +++ b/test/helpers/components/common.go @@ -21,8 +21,9 @@ import ( "fmt" "time" - "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + appsv1 "k8s.io/api/apps/v1" "sigs.k8s.io/cluster-api/test/helpers/flag" "sigs.k8s.io/cluster-api/test/helpers/kind" @@ -39,13 +40,13 @@ var ( func DeployCAPIComponents(kindCluster kind.Cluster) { Expect(capiComponents).ToNot(BeNil()) - fmt.Fprintf(ginkgo.GinkgoWriter, "Applying cluster-api components\n") + fmt.Fprintf(GinkgoWriter, "Applying cluster-api components\n") Expect(*capiComponents).ToNot(BeEmpty()) kindCluster.ApplyYAML(*capiComponents) } func WaitDeployment(c client.Client, namespace, name string) { - fmt.Fprintf(ginkgo.GinkgoWriter, "Ensuring %s/%s is deployed\n", namespace, name) + fmt.Fprintf(GinkgoWriter, "Ensuring %s/%s is deployed\n", namespace, name) Eventually( func() (int32, error) { deployment := &appsv1.Deployment{} diff --git a/test/helpers/kind/setup.go b/test/helpers/kind/setup.go index f73ca7f4bff8..e0bfefc41c37 100644 --- a/test/helpers/kind/setup.go +++ b/test/helpers/kind/setup.go @@ -28,8 +28,9 @@ import ( "strings" "sync" - "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "k8s.io/client-go/kubernetes" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" @@ -58,12 +59,12 @@ func (c *Cluster) Setup() { var err error c.tmpDir, err = ioutil.TempDir("", "kind-home") ExpectWithOffset(1, err).NotTo(HaveOccurred()) - fmt.Fprintf(ginkgo.GinkgoWriter, "creating Kind cluster named %q\n", c.Name) + fmt.Fprintf(GinkgoWriter, "creating Kind cluster named %q\n", c.Name) c.run(exec.Command(*kindBinary, "create", "cluster", "--image", kindestImage, "--name", c.Name)) path := c.runWithOutput(exec.Command(*kindBinary, "get", "kubeconfig-path", "--name", c.Name)) c.kubepath = strings.TrimSpace(string(path)) - fmt.Fprintf(ginkgo.GinkgoWriter, "kubeconfig path: %q. Can use the following to access the cluster:\n", c.kubepath) - fmt.Fprintf(ginkgo.GinkgoWriter, "export KUBECONFIG=%s\n", c.kubepath) + fmt.Fprintf(GinkgoWriter, "kubeconfig path: %q. Can use the following to access the cluster:\n", c.kubepath) + fmt.Fprintf(GinkgoWriter, "export KUBECONFIG=%s\n", c.kubepath) } // Teardown attempts to delete the KIND cluster @@ -75,7 +76,7 @@ func (c *Cluster) Teardown() { // LoadImage loads the specified image archive into the kind cluster func (c *Cluster) LoadImage(image string) { fmt.Fprintf( - ginkgo.GinkgoWriter, + GinkgoWriter, "loading image %q into Kind node\n", image) c.run(exec.Command(*kindBinary, "load", "docker-image", "--name", c.Name, image)) //nolint:gosec @@ -149,7 +150,7 @@ func captureOutput(wg *sync.WaitGroup, r io.Reader, label string) { for { line, err := reader.ReadString('\n') - fmt.Fprintf(ginkgo.GinkgoWriter, "[%s] %s", label, line) + fmt.Fprintf(GinkgoWriter, "[%s] %s", label, line) if err != nil { return } diff --git a/test/helpers/scheme/scheme.go b/test/helpers/scheme/scheme.go index bf6a5d37129f..68e0c89727e8 100644 --- a/test/helpers/scheme/scheme.go +++ b/test/helpers/scheme/scheme.go @@ -18,6 +18,7 @@ package scheme import ( . "github.com/onsi/gomega" + "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" diff --git a/test/infrastructure/docker/e2e/custom_assertions.go b/test/infrastructure/docker/e2e/custom_assertions.go index da460f2dede0..7339fc6a3c11 100644 --- a/test/infrastructure/docker/e2e/custom_assertions.go +++ b/test/infrastructure/docker/e2e/custom_assertions.go @@ -24,6 +24,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "k8s.io/apimachinery/pkg/labels" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" diff --git a/test/infrastructure/docker/e2e/docker_suite_test.go b/test/infrastructure/docker/e2e/docker_suite_test.go index a31d4d46d302..b192578357b9 100644 --- a/test/infrastructure/docker/e2e/docker_suite_test.go +++ b/test/infrastructure/docker/e2e/docker_suite_test.go @@ -29,7 +29,7 @@ import ( "testing" . "github.com/onsi/ginkgo" - ginkgoConfig "github.com/onsi/ginkgo/config" + . "github.com/onsi/ginkgo/config" "github.com/onsi/ginkgo/reporters" . "github.com/onsi/gomega" @@ -47,7 +47,7 @@ import ( func TestDocker(t *testing.T) { RegisterFailHandler(Fail) - junitPath := fmt.Sprintf("junit.e2e_suite.%d.xml", ginkgoConfig.GinkgoConfig.ParallelNode) + junitPath := fmt.Sprintf("junit.e2e_suite.%d.xml", GinkgoConfig.ParallelNode) artifactPath, exists := os.LookupEnv("ARTIFACTS") if exists { junitPath = path.Join(artifactPath, junitPath) diff --git a/test/integration/cluster/cluster_test.go b/test/integration/cluster/cluster_test.go index 76be8b394929..26b75fa4e041 100644 --- a/test/integration/cluster/cluster_test.go +++ b/test/integration/cluster/cluster_test.go @@ -25,6 +25,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" diff --git a/util/conversion/conversion.go b/util/conversion/conversion.go index cabe54e89b63..dee39b6b2b0b 100644 --- a/util/conversion/conversion.go +++ b/util/conversion/conversion.go @@ -25,6 +25,7 @@ import ( fuzz "github.com/google/gofuzz" "github.com/onsi/gomega" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" diff --git a/util/conversion/conversion_test.go b/util/conversion/conversion_test.go index 01b2e112183f..2396eea4728b 100644 --- a/util/conversion/conversion_test.go +++ b/util/conversion/conversion_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clusterv1a2 "sigs.k8s.io/cluster-api/api/v1alpha3" clusterv1a3 "sigs.k8s.io/cluster-api/api/v1alpha3" diff --git a/util/kubeconfig/kubeconfig_test.go b/util/kubeconfig/kubeconfig_test.go index bf33cd2631ed..e646b61081cf 100644 --- a/util/kubeconfig/kubeconfig_test.go +++ b/util/kubeconfig/kubeconfig_test.go @@ -28,6 +28,7 @@ import ( "time" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/util/patch/patch_test.go b/util/patch/patch_test.go index b314702edf97..814ce15f54c8 100644 --- a/util/patch/patch_test.go +++ b/util/patch/patch_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/util/util_test.go b/util/util_test.go index 413b6a9d995b..33d0878af5fc 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -22,6 +22,7 @@ import ( "testing" . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime"