Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use goimports for import grouping #809

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/cmd/podidentity/detect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import (
"testing"
"time"

"github.com/Azure/azure-workload-identity/pkg/cmd/podidentity/k8s"
"github.com/Azure/azure-workload-identity/pkg/webhook"

aadpodv1 "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
Expand All @@ -19,6 +16,9 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer/json"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

"github.com/Azure/azure-workload-identity/pkg/cmd/podidentity/k8s"
"github.com/Azure/azure-workload-identity/pkg/webhook"
)

var (
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/serviceaccount/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import (
"context"
"fmt"

"github.com/microsoftgraph/msgraph-beta-sdk-go/models/microsoft/graph"
"github.com/spf13/cobra"
"monis.app/mlog"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/Azure/azure-workload-identity/pkg/cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/auth"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/options"
phases "github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/delete"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/util"
"github.com/Azure/azure-workload-identity/pkg/kuberneteshelper"
"monis.app/mlog"

"github.com/microsoftgraph/msgraph-beta-sdk-go/models/microsoft/graph"
"github.com/spf13/cobra"
"sigs.k8s.io/controller-runtime/pkg/client"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/serviceaccount/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package serviceaccount
import (
"testing"

"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"

"github.com/golang/mock/gomock"
"github.com/pkg/errors"

"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
)

func TestDeleteDataServiceAccountName(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/serviceaccount/phases/create/aadapplication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
"testing"

"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"

"github.com/Azure/go-autorest/autorest/to"
"github.com/golang/mock/gomock"
"github.com/microsoftgraph/msgraph-beta-sdk-go/models/microsoft/graph"

"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
)

func TestAADApplicationPreRun(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/serviceaccount/phases/create/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package phases
import (
"time"

"github.com/Azure/azure-workload-identity/pkg/cloud"

"github.com/microsoftgraph/msgraph-beta-sdk-go/models/microsoft/graph"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/Azure/azure-workload-identity/pkg/cloud"
)

// CreateData is the interface to use for create phase.
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/serviceaccount/phases/create/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"fmt"
"time"

"github.com/Azure/azure-workload-identity/pkg/cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/util"

"github.com/microsoftgraph/msgraph-beta-sdk-go/models/microsoft/graph"
"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/Azure/azure-workload-identity/pkg/cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/util"
)

type mockCreateData struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import (
"fmt"
"testing"

"github.com/Azure/go-autorest/autorest/to"
"github.com/golang/mock/gomock"
"github.com/microsoftgraph/msgraph-beta-sdk-go/models/microsoft/graph"

"github.com/Azure/azure-workload-identity/pkg/cloud"
"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/util"
"github.com/Azure/azure-workload-identity/pkg/webhook"

"github.com/Azure/go-autorest/autorest/to"
"github.com/golang/mock/gomock"
"github.com/microsoftgraph/msgraph-beta-sdk-go/models/microsoft/graph"
)

func TestFederatedIdentityPreRun(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/serviceaccount/phases/create/roleassignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"net/http"
"testing"

"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"

"github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2018-01-01-preview/authorization"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/to"
"github.com/golang/mock/gomock"

"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
)

func TestRoleAssignmentPreRun(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/serviceaccount/phases/create/serviceaccount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"testing"
"time"

"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
"github.com/Azure/azure-workload-identity/pkg/webhook"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
"github.com/Azure/azure-workload-identity/pkg/webhook"
)

func TestServiceAccountPreRun(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/serviceaccount/phases/delete/aadapplication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"context"
"testing"

"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"

"github.com/golang/mock/gomock"
"github.com/pkg/errors"

"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
)

func TestAADApplicationPreRun(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/serviceaccount/phases/delete/data.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package phases

import (
"github.com/Azure/azure-workload-identity/pkg/cloud"

"github.com/microsoftgraph/msgraph-beta-sdk-go/models/microsoft/graph"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/Azure/azure-workload-identity/pkg/cloud"
)

// DeleteData is the interface to use for create phase.
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/serviceaccount/phases/delete/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package phases
import (
"fmt"

"github.com/Azure/azure-workload-identity/pkg/cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/util"

"github.com/microsoftgraph/msgraph-beta-sdk-go/models/microsoft/graph"
"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/Azure/azure-workload-identity/pkg/cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/util"
)

type mockDeleteData struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import (
"context"
"testing"

"github.com/Azure/azure-workload-identity/pkg/cloud"
"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/util"

"github.com/Azure/go-autorest/autorest/to"
"github.com/golang/mock/gomock"
"github.com/microsoftgraph/msgraph-beta-sdk-go/models/microsoft/graph"
"github.com/pkg/errors"

"github.com/Azure/azure-workload-identity/pkg/cloud"
"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/util"
)

func TestFederatedIdentityPreRun(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/serviceaccount/phases/delete/roleassignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"net/http"
"testing"

"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"

authorization "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2018-01-01-preview/authorization"
"github.com/Azure/go-autorest/autorest"
"github.com/golang/mock/gomock"
"github.com/pkg/errors"

"github.com/Azure/azure-workload-identity/pkg/cloud/mock_cloud"
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
)

func TestRoleAssignmentPreRun(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/serviceaccount/phases/delete/serviceaccount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"context"
"testing"

"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/phases/workflow"
)

func TestServiceAccountPreRun(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/serviceaccount/root.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package serviceaccount

import (
"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/auth"

"github.com/spf13/cobra"

"github.com/Azure/azure-workload-identity/pkg/cmd/serviceaccount/auth"
)

// NewServiceAccountCmd returns a new serviceaccount command
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/version/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package version
import (
"fmt"

"github.com/Azure/azure-workload-identity/pkg/version"

"github.com/spf13/cobra"

"github.com/Azure/azure-workload-identity/pkg/version"
)

// NewVersionCmd returns a new version command
Expand Down
4 changes: 2 additions & 2 deletions pkg/kuberneteshelper/serviceaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"fmt"
"time"

"github.com/Azure/azure-workload-identity/pkg/webhook"

corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/Azure/azure-workload-identity/pkg/webhook"
)

// Create ServiceAccount in the cluster
Expand Down
4 changes: 2 additions & 2 deletions pkg/kuberneteshelper/serviceaccount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"testing"
"time"

"github.com/Azure/azure-workload-identity/pkg/webhook"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

"github.com/Azure/azure-workload-identity/pkg/webhook"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"context"
"path/filepath"

"github.com/Azure/azure-workload-identity/pkg/webhook"

"github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand All @@ -18,6 +16,8 @@ import (
e2edeploy "k8s.io/kubernetes/test/e2e/framework/deployment"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
"k8s.io/utils/pointer"

"github.com/Azure/azure-workload-identity/pkg/webhook"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import (
"os"
"strings"

"github.com/Azure/azure-workload-identity/pkg/webhook"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/test/e2e/framework"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"

"github.com/Azure/azure-workload-identity/pkg/webhook"
)

// The proxy implementation is only for Linux.
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/token_exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"os"
"strings"

"github.com/Azure/azure-workload-identity/pkg/webhook"

"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/test/e2e/framework"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"

"github.com/Azure/azure-workload-identity/pkg/webhook"
)

// Only kind cluster supports custom service account issuer for now.
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
"fmt"
"strings"

"github.com/Azure/azure-workload-identity/pkg/webhook"

"github.com/onsi/ginkgo/v2"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/utils/pointer"

"github.com/Azure/azure-workload-identity/pkg/webhook"
)

var _ = ginkgo.Describe("Webhook", func() {
Expand Down