From a4cdf007f26439b2dfc587c3b44f94d1a004c4a5 Mon Sep 17 00:00:00 2001 From: Gaurav Gahlot Date: Fri, 5 Mar 2021 15:12:14 +0530 Subject: [PATCH] group module imports Signed-off-by: Gaurav Gahlot --- tink/client/fake/hardware.go | 3 ++- tink/client/fake/template.go | 3 ++- tink/client/fake/workflow.go | 3 ++- tink/client_test/hardware_test.go | 1 + tink/client_test/template_test.go | 3 ++- tink/client_test/workflow_test.go | 3 ++- tink/controllers/common_test/common_test.go | 5 +++-- tink/controllers/hardware/controller.go | 3 ++- tink/controllers/template/controller.go | 7 ++++--- tink/controllers/template/controller_internal_test.go | 5 +++-- tink/controllers/workflow/controller.go | 7 ++++--- tink/sources/tink_events_internal_test.go | 3 ++- tink/sources_test/tink_events_test.go | 9 +++++---- 13 files changed, 34 insertions(+), 21 deletions(-) diff --git a/tink/client/fake/hardware.go b/tink/client/fake/hardware.go index 9ec55dc6..351bc609 100644 --- a/tink/client/fake/hardware.go +++ b/tink/client/fake/hardware.go @@ -22,9 +22,10 @@ import ( "errors" "github.com/google/uuid" - "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" "github.com/tinkerbell/tink/protos/hardware" "google.golang.org/protobuf/proto" + + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" ) // Hardware is a fake client for Tinkerbell Hardwares. diff --git a/tink/client/fake/template.go b/tink/client/fake/template.go index ec7da339..f6537b01 100644 --- a/tink/client/fake/template.go +++ b/tink/client/fake/template.go @@ -22,9 +22,10 @@ import ( "errors" "github.com/google/uuid" - "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" "github.com/tinkerbell/tink/protos/template" "google.golang.org/protobuf/proto" + + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" ) // Template is a fake client for Tinkerbell Templates. diff --git a/tink/client/fake/workflow.go b/tink/client/fake/workflow.go index c7e85433..e3d3c5fe 100644 --- a/tink/client/fake/workflow.go +++ b/tink/client/fake/workflow.go @@ -21,9 +21,10 @@ import ( "context" "github.com/google/uuid" - "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" "github.com/tinkerbell/tink/protos/workflow" "google.golang.org/protobuf/proto" + + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" ) // Workflow is a fake client for Tinkerbell Workflows. diff --git a/tink/client_test/hardware_test.go b/tink/client_test/hardware_test.go index c2fa8068..32a43ebd 100644 --- a/tink/client_test/hardware_test.go +++ b/tink/client_test/hardware_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" testutils "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/test/utils" ) diff --git a/tink/client_test/template_test.go b/tink/client_test/template_test.go index abb0b71a..5cbc4cf5 100644 --- a/tink/client_test/template_test.go +++ b/tink/client_test/template_test.go @@ -21,9 +21,10 @@ import ( "testing" . "github.com/onsi/gomega" + "k8s.io/apimachinery/pkg/util/rand" + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" testutils "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/test/utils" - "k8s.io/apimachinery/pkg/util/rand" ) const ( diff --git a/tink/client_test/workflow_test.go b/tink/client_test/workflow_test.go index a38c8b86..7ee41277 100644 --- a/tink/client_test/workflow_test.go +++ b/tink/client_test/workflow_test.go @@ -21,9 +21,10 @@ import ( "testing" . "github.com/onsi/gomega" + "k8s.io/apimachinery/pkg/util/rand" + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" testutils "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/test/utils" - "k8s.io/apimachinery/pkg/util/rand" ) func TestWorkflowLifecycle(t *testing.T) { //nolint:paralleltest diff --git a/tink/controllers/common_test/common_test.go b/tink/controllers/common_test/common_test.go index 9b19db42..0bcbb163 100644 --- a/tink/controllers/common_test/common_test.go +++ b/tink/controllers/common_test/common_test.go @@ -21,13 +21,14 @@ import ( "testing" . "github.com/onsi/gomega" - tinkv1alpha1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" - "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/controllers/common" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/log" + + tinkv1alpha1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/controllers/common" ) func Test_EnsureFinalizer(t *testing.T) { diff --git a/tink/controllers/hardware/controller.go b/tink/controllers/hardware/controller.go index 5f850cea..45e44110 100644 --- a/tink/controllers/hardware/controller.go +++ b/tink/controllers/hardware/controller.go @@ -22,7 +22,6 @@ import ( "fmt" "github.com/go-logr/logr" - tinkv1alpha1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" "github.com/tinkerbell/tink/protos/hardware" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" @@ -32,6 +31,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/source" + + tinkv1alpha1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" ) type hardwareClient interface { diff --git a/tink/controllers/template/controller.go b/tink/controllers/template/controller.go index cdb2ef8c..712fcf84 100644 --- a/tink/controllers/template/controller.go +++ b/tink/controllers/template/controller.go @@ -23,9 +23,6 @@ import ( "fmt" "github.com/go-logr/logr" - tinkv1alpha1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" - tinkclient "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" - "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/controllers/common" "github.com/tinkerbell/tink/protos/template" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" @@ -36,6 +33,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/source" + + tinkv1alpha1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" + tinkclient "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/controllers/common" ) type templateClient interface { diff --git a/tink/controllers/template/controller_internal_test.go b/tink/controllers/template/controller_internal_test.go index e5c0158f..066e9438 100644 --- a/tink/controllers/template/controller_internal_test.go +++ b/tink/controllers/template/controller_internal_test.go @@ -22,8 +22,6 @@ import ( "testing" . "github.com/onsi/gomega" - tinkv1alpha1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" - tinkfake "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client/fake" "github.com/tinkerbell/tink/protos/template" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -32,6 +30,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/log" + + tinkv1alpha1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" + tinkfake "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client/fake" ) const helloWorldTemplate = `version: "0.1" diff --git a/tink/controllers/workflow/controller.go b/tink/controllers/workflow/controller.go index 431d4e3e..2e07087c 100644 --- a/tink/controllers/workflow/controller.go +++ b/tink/controllers/workflow/controller.go @@ -24,9 +24,6 @@ import ( "time" "github.com/go-logr/logr" - tinkv1alpha1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" - tinkclient "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" - "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/controllers/common" "github.com/tinkerbell/tink/protos/workflow" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -37,6 +34,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/source" + + tinkv1alpha1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" + tinkclient "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/controllers/common" ) type workflowClient interface { diff --git a/tink/sources/tink_events_internal_test.go b/tink/sources/tink_events_internal_test.go index 7b7923bf..c5d0804c 100644 --- a/tink/sources/tink_events_internal_test.go +++ b/tink/sources/tink_events_internal_test.go @@ -22,13 +22,14 @@ import ( "testing" . "github.com/onsi/gomega" - tinkv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" tinkevents "github.com/tinkerbell/tink/protos/events" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/log" + + tinkv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" ) func TestTinkEventWatcher_generateEventForTinkID(t *testing.T) { //nolint:funlen diff --git a/tink/sources_test/tink_events_test.go b/tink/sources_test/tink_events_test.go index f41e8f81..7a5aa4d2 100644 --- a/tink/sources_test/tink_events_test.go +++ b/tink/sources_test/tink_events_test.go @@ -23,10 +23,6 @@ import ( "testing" . "github.com/onsi/gomega" - tinkv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" - "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" - "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/sources" - testutils "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/test/utils" rawclient "github.com/tinkerbell/tink/client" "github.com/tinkerbell/tink/protos/events" "github.com/tinkerbell/tink/protos/hardware" @@ -41,6 +37,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/log" + + tinkv1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/api/v1alpha1" + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/client" + "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/sources" + testutils "github.com/tinkerbell/cluster-api-provider-tinkerbell/tink/test/utils" ) const (