diff --git a/datastore/datastore.go b/datastore/datastore.go index fbe7c077b5..11cf13261f 100644 --- a/datastore/datastore.go +++ b/datastore/datastore.go @@ -3,8 +3,11 @@ package datastore import ( "time" - apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/informers" + "k8s.io/client-go/tools/cache" + + apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + apierrors "k8s.io/apimachinery/pkg/api/errors" clientset "k8s.io/client-go/kubernetes" appslisters "k8s.io/client-go/listers/apps/v1" batchlisters_v1 "k8s.io/client-go/listers/batch/v1" @@ -12,12 +15,10 @@ import ( policylisters "k8s.io/client-go/listers/policy/v1" schedulinglisters "k8s.io/client-go/listers/scheduling/v1" storagelisters_v1 "k8s.io/client-go/listers/storage/v1" - "k8s.io/client-go/tools/cache" lhclientset "github.com/longhorn/longhorn-manager/k8s/pkg/client/clientset/versioned" lhinformers "github.com/longhorn/longhorn-manager/k8s/pkg/client/informers/externalversions" lhlisters "github.com/longhorn/longhorn-manager/k8s/pkg/client/listers/longhorn/v1beta2" - apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" ) var ( diff --git a/datastore/kubernetes.go b/datastore/kubernetes.go index e58f904b9f..24853327be 100644 --- a/datastore/kubernetes.go +++ b/datastore/kubernetes.go @@ -11,6 +11,11 @@ import ( "github.com/sirupsen/logrus" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/version" + "k8s.io/client-go/rest" + appsv1 "k8s.io/api/apps/v1" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" @@ -20,11 +25,7 @@ import ( schedulingv1 "k8s.io/api/scheduling/v1" storagev1 "k8s.io/api/storage/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/version" - "k8s.io/client-go/rest" "github.com/longhorn/longhorn-manager/types" diff --git a/datastore/longhorn.go b/datastore/longhorn.go index cac26544ed..9f50b6fcd1 100644 --- a/datastore/longhorn.go +++ b/datastore/longhorn.go @@ -12,18 +12,20 @@ import ( "github.com/robfig/cron" "github.com/sirupsen/logrus" - corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation" - longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/longhorn/longhorn-manager/types" "github.com/longhorn/longhorn-manager/util" + + longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2" ) const ( diff --git a/datastore/uncached.go b/datastore/uncached.go index cc038931e7..2ecd8b9629 100644 --- a/datastore/uncached.go +++ b/datastore/uncached.go @@ -3,15 +3,17 @@ package datastore import ( "context" + "k8s.io/apimachinery/pkg/runtime" + corev1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - longhornapis "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn" "github.com/longhorn/longhorn-manager/types" "github.com/longhorn/longhorn-manager/util" + + longhornapis "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn" ) // GetLonghornEventList returns an uncached list of longhorn events for the