Skip to content

Commit

Permalink
Merge pull request tinkerbell#46 from gauravgahlot/address-feedback
Browse files Browse the repository at this point in the history
Group module imports
  • Loading branch information
detiber authored Mar 8, 2021
2 parents 6b229d4 + a4cdf00 commit 65495a8
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 21 deletions.
3 changes: 2 additions & 1 deletion tink/client/fake/hardware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion tink/client/fake/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion tink/client/fake/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions tink/client_test/hardware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
3 changes: 2 additions & 1 deletion tink/client_test/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion tink/client_test/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions tink/controllers/common_test/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion tink/controllers/hardware/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
7 changes: 4 additions & 3 deletions tink/controllers/template/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions tink/controllers/template/controller_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
7 changes: 4 additions & 3 deletions tink/controllers/workflow/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion tink/sources/tink_events_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions tink/sources_test/tink_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 (
Expand Down

0 comments on commit 65495a8

Please sign in to comment.