Skip to content

Commit

Permalink
goimports works now better, fix imports
Browse files Browse the repository at this point in the history
A new version of goimports better sorts our dependencies.
  • Loading branch information
rmohr committed Oct 15, 2018
1 parent 3a703d8 commit 070a2e8
Show file tree
Hide file tree
Showing 133 changed files with 222 additions and 420 deletions.
6 changes: 2 additions & 4 deletions cmd/virt-handler/virt-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"

"kubevirt.io/kubevirt/pkg/util"

"kubevirt.io/kubevirt/pkg/certificates"

"kubevirt.io/kubevirt/pkg/api/v1"
"kubevirt.io/kubevirt/pkg/certificates"
"kubevirt.io/kubevirt/pkg/controller"
"kubevirt.io/kubevirt/pkg/inotify-informer"
"kubevirt.io/kubevirt/pkg/kubecli"
Expand All @@ -50,6 +47,7 @@ import (
_ "kubevirt.io/kubevirt/pkg/monitoring/reflector/prometheus" // import for prometheus metrics
_ "kubevirt.io/kubevirt/pkg/monitoring/workqueue/prometheus" // import for prometheus metrics
"kubevirt.io/kubevirt/pkg/service"
"kubevirt.io/kubevirt/pkg/util"
"kubevirt.io/kubevirt/pkg/virt-handler"
virtcache "kubevirt.io/kubevirt/pkg/virt-handler/cache"
"kubevirt.io/kubevirt/pkg/virt-launcher"
Expand Down
5 changes: 2 additions & 3 deletions cmd/virtctl/virtctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ package main
import (
"os"

"kubevirt.io/kubevirt/pkg/virtctl"

// Import to initialize client auth plugins.
_ "k8s.io/client-go/plugin/pkg/client/auth"

"kubevirt.io/kubevirt/pkg/virtctl" // Import to initialize client auth plugins.
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion hack/docker-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN \
source /etc/profile.d/gimme.sh && \
go get github.com/mattn/goveralls && \
go get -u github.com/Masterminds/glide && \
go get golang.org/x/tools/cmd/goimports && \
go get -u golang.org/x/tools/cmd/goimports && \
git clone https://github.com/mvdan/sh.git $GOPATH/src/mvdan.cc/sh && \
cd /go/src/mvdan.cc/sh/cmd/shfmt && \
git checkout v2.5.0 && \
Expand Down
7 changes: 2 additions & 5 deletions pkg/api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,12 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"

"kubevirt.io/kubevirt/pkg/precond"

"k8s.io/apimachinery/pkg/runtime/serializer"

"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes/scheme"

cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/datavolumecontroller/v1alpha1"
"kubevirt.io/kubevirt/pkg/precond"
)

// GroupName is the group name use in this package
Expand Down
3 changes: 1 addition & 2 deletions pkg/api/v1/v1_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ package v1

import (
"io/ioutil"
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"kubevirt.io/kubevirt/pkg/log"

"testing"
)

func TestV1(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud-init/cloudinit_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
package cloudinit

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"kubevirt.io/kubevirt/pkg/log"

"testing"
)

func TestCloudInit(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion pkg/config/config-map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

k8sv1 "k8s.io/api/core/v1"

"kubevirt.io/kubevirt/pkg/api/v1"
Expand Down
9 changes: 3 additions & 6 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
package controller

import (
"fmt"
"runtime/debug"

"github.com/golang/glog"
k8sv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
Expand All @@ -31,14 +33,9 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"

"fmt"

k8sv1 "k8s.io/api/core/v1"

cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/datavolumecontroller/v1alpha1"
"kubevirt.io/kubevirt/pkg/api/v1"
"kubevirt.io/kubevirt/pkg/log"

cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/datavolumecontroller/v1alpha1"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/controller_ref_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ import (
"k8s.io/apimachinery/pkg/types"
utilerrors "k8s.io/apimachinery/pkg/util/errors"

cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/datavolumecontroller/v1alpha1"
virtv1 "kubevirt.io/kubevirt/pkg/api/v1"
"kubevirt.io/kubevirt/pkg/kubecli"
"kubevirt.io/kubevirt/pkg/log"

cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/datavolumecontroller/v1alpha1"
)

// GetControllerOf returns the controllerRef if controllee has a controller,
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/controller_ref_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ package controller

import (
"reflect"
"testing"

"sync"
"testing"

"k8s.io/api/core/v1"
"k8s.io/api/extensions/v1beta1"
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/controller_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package controller_test

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"kubevirt.io/kubevirt/pkg/log"

"testing"
)

func TestController(t *testing.T) {
Expand Down
4 changes: 1 addition & 3 deletions pkg/controller/virtinformers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ import (
"sync"
"time"

k8sv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"

k8sv1 "k8s.io/api/core/v1"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"

cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/datavolumecontroller/v1alpha1"
cdiv1informers "kubevirt.io/containerized-data-importer/pkg/client/informers/externalversions"

kubev1 "kubevirt.io/kubevirt/pkg/api/v1"
"kubevirt.io/kubevirt/pkg/kubecli"
"kubevirt.io/kubevirt/pkg/log"
Expand Down
3 changes: 1 addition & 2 deletions pkg/emptydisk/emptydisk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ package emptydisk
import (
"io/ioutil"
"os"
"path"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/api/resource"

"path"

"kubevirt.io/kubevirt/pkg/api/v1"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/ephemeral-disk/ephemeral-disk_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
package ephemeraldisk

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"kubevirt.io/kubevirt/pkg/log"

"testing"
)

func TestRegistryDisk(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion pkg/ephemeral-disk/ephemeral-disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

k8sv1 "k8s.io/api/core/v1"

"kubevirt.io/kubevirt/pkg/api/v1"
Expand Down
6 changes: 2 additions & 4 deletions pkg/feature-gates/feature-gates.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ import (
"time"

k8sv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"

"kubevirt.io/kubevirt/pkg/util"

"k8s.io/apimachinery/pkg/api/errors"

"kubevirt.io/kubevirt/pkg/kubecli"
"kubevirt.io/kubevirt/pkg/util"
)

const featureGateEnvVar = "FEATURE_GATES"
Expand Down
3 changes: 1 addition & 2 deletions pkg/host-disk/host-disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ import (
"path"
"syscall"

"kubevirt.io/kubevirt/pkg/util/types"

k8sv1 "k8s.io/api/core/v1"

"kubevirt.io/kubevirt/pkg/api/v1"
"kubevirt.io/kubevirt/pkg/kubecli"
"kubevirt.io/kubevirt/pkg/util/types"
)

const pvcBaseDir = "/var/run/kubevirt-private/vmi-disks"
Expand Down
13 changes: 5 additions & 8 deletions pkg/host-disk/host-disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,16 @@ import (
"path"

"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"
k8sv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/fake"

"kubevirt.io/kubevirt/pkg/api/v1"
"kubevirt.io/kubevirt/pkg/kubecli"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"k8s.io/apimachinery/pkg/api/resource"

k8sv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

var _ = Describe("HostDisk", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/inotify-informer/inotify_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
package inotifyinformer

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"kubevirt.io/kubevirt/pkg/log"

"testing"
)

func TestInotifyInformer(t *testing.T) {
Expand Down
4 changes: 1 addition & 3 deletions pkg/kubecli/kubecli.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"flag"
"os"

"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/client-go/kubernetes"
Expand All @@ -33,9 +34,6 @@ import (
"k8s.io/client-go/tools/clientcmd"

cdiclient "kubevirt.io/containerized-data-importer/pkg/client/clientset/versioned"

"github.com/spf13/pflag"

"kubevirt.io/kubevirt/pkg/api/v1"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/kubecli/kubecli_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
package kubecli_test

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"kubevirt.io/kubevirt/pkg/log"

"testing"
)

func TestKubecli(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion pkg/kubecli/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"k8s.io/client-go/rest"

cdiclient "kubevirt.io/containerized-data-importer/pkg/client/clientset/versioned"

"kubevirt.io/kubevirt/pkg/api/v1"
)

Expand Down
3 changes: 1 addition & 2 deletions pkg/kubecli/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ package kubecli

import (
k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"

"k8s.io/apimachinery/pkg/types"

"kubevirt.io/kubevirt/pkg/api/v1"
)

Expand Down
4 changes: 1 addition & 3 deletions pkg/kubecli/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ import (
. "github.com/onsi/gomega"
"github.com/onsi/gomega/ghttp"
k8sv1 "k8s.io/api/core/v1"
k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"k8s.io/apimachinery/pkg/api/errors"

k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
)
Expand Down
4 changes: 1 addition & 3 deletions pkg/kubecli/replicaset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ import (
. "github.com/onsi/gomega"
"github.com/onsi/gomega/ghttp"
k8sv1 "k8s.io/api/core/v1"
k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"k8s.io/apimachinery/pkg/api/errors"

k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)

Expand Down
4 changes: 1 addition & 3 deletions pkg/kubecli/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
package kubecli

import (
"net/http"

"fmt"
"net/http"
"runtime"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/ghttp"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"kubevirt.io/kubevirt/pkg/version"
Expand Down
Loading

0 comments on commit 070a2e8

Please sign in to comment.