Skip to content

Commit

Permalink
refactor: cleanup imports
Browse files Browse the repository at this point in the history
Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
  • Loading branch information
c3y1huang authored and David Ko committed Aug 21, 2023
1 parent 59b4379 commit acb922e
Show file tree
Hide file tree
Showing 85 changed files with 783 additions and 683 deletions.
1 change: 1 addition & 0 deletions api/backingimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"
)
Expand Down
3 changes: 2 additions & 1 deletion api/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"
"github.com/sirupsen/logrus"
)

func (s *Server) BackupTargetList(w http.ResponseWriter, req *http.Request) error {
Expand Down
1 change: 1 addition & 0 deletions api/engineimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"

Expand Down
7 changes: 4 additions & 3 deletions api/forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

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

"github.com/longhorn/longhorn-manager/engineapi"
longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2"
"github.com/longhorn/longhorn-manager/manager"
"github.com/longhorn/longhorn-manager/types"

longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2"
)

const (
Expand Down Expand Up @@ -180,7 +181,7 @@ func UploadParametersForBackingImage(m *manager.VolumeManager) func(req *http.Re
if err != nil {
return nil, err
}
if pod.Status.Phase != v1.PodRunning || pod.Status.PodIP == "" {
if pod.Status.Phase != corev1.PodRunning || pod.Status.PodIP == "" {
return nil, fmt.Errorf("backing image data source pod is not ready for uploading")
}
bids, err := m.GetBackingImageDataSource(name)
Expand Down
1 change: 1 addition & 0 deletions api/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"
)
Expand Down
14 changes: 8 additions & 6 deletions api/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ import (
"strconv"
"time"

"github.com/sirupsen/logrus"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"
"github.com/sirupsen/logrus"

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

"github.com/longhorn/longhorn-manager/controller"
"github.com/longhorn/longhorn-manager/datastore"
"github.com/longhorn/longhorn-manager/engineapi"
"github.com/longhorn/longhorn-manager/manager"
"github.com/longhorn/longhorn-manager/types"
"github.com/longhorn/longhorn-manager/util"
v1 "k8s.io/api/core/v1"

longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2"
)
Expand Down Expand Up @@ -382,8 +384,8 @@ type DiskUpdateInput struct {

type Event struct {
client.Resource
Event v1.Event `json:"event"`
EventType string `json:"eventType"`
Event corev1.Event `json:"event"`
EventType string `json:"eventType"`
}

type SupportBundle struct {
Expand Down Expand Up @@ -1886,7 +1888,7 @@ func toNodeCollection(nodeList []*longhorn.Node, nodeIPMap map[string]string, ap
return &client.GenericCollection{Data: data, Collection: client.Collection{ResourceType: "node"}}
}

func toEventResource(event v1.Event) *Event {
func toEventResource(event corev1.Event) *Event {
e := &Event{
Resource: client.Resource{
Id: event.Name,
Expand All @@ -1899,7 +1901,7 @@ func toEventResource(event v1.Event) *Event {
return e
}

func toEventCollection(eventList *v1.EventList) *client.GenericCollection {
func toEventCollection(eventList *corev1.EventList) *client.GenericCollection {
data := []interface{}{}
for _, event := range eventList.Items {
data = append(data, toEventResource(event))
Expand Down
1 change: 1 addition & 0 deletions api/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"

Expand Down
1 change: 1 addition & 0 deletions api/orphan.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"
)
Expand Down
4 changes: 3 additions & 1 deletion api/recurringjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"

longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2"
"github.com/longhorn/longhorn-manager/util"

longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2"
)

func (s *Server) RecurringJobList(rw http.ResponseWriter, req *http.Request) (err error) {
Expand Down
3 changes: 2 additions & 1 deletion api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"net/http"

"github.com/gorilla/mux"
"github.com/sirupsen/logrus"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"
"github.com/sirupsen/logrus"

"github.com/longhorn/longhorn-manager/datastore"
"github.com/longhorn/longhorn-manager/metrics_collector/registry"
Expand Down
1 change: 1 addition & 0 deletions api/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"

Expand Down
5 changes: 4 additions & 1 deletion api/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"

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

bsutil "github.com/longhorn/backupstore/util"
longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2"

"github.com/longhorn/longhorn-manager/types"
"github.com/longhorn/longhorn-manager/util"

longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2"
)

func (s *Server) SnapshotCreate(w http.ResponseWriter, req *http.Request) (err error) {
Expand Down
3 changes: 2 additions & 1 deletion api/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (

"github.com/gorilla/mux"
"github.com/gorilla/websocket"
"github.com/sirupsen/logrus"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"
"github.com/sirupsen/logrus"

"github.com/longhorn/longhorn-manager/controller"
)
Expand Down
1 change: 1 addition & 0 deletions api/supportbundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"

Expand Down
1 change: 1 addition & 0 deletions api/systembackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"

Expand Down
1 change: 1 addition & 0 deletions api/systemrestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"
)
Expand Down
1 change: 1 addition & 0 deletions api/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"

"github.com/rancher/go-rancher/api"
"github.com/rancher/go-rancher/client"

Expand Down
4 changes: 3 additions & 1 deletion app/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ import (
"github.com/urfave/cli"

"github.com/longhorn/go-iscsi-helper/iscsi"

iscsiutil "github.com/longhorn/go-iscsi-helper/util"

"github.com/longhorn/longhorn-manager/api"
"github.com/longhorn/longhorn-manager/controller"
"github.com/longhorn/longhorn-manager/datastore"
"github.com/longhorn/longhorn-manager/manager"
"github.com/longhorn/longhorn-manager/meta"
metricsCollector "github.com/longhorn/longhorn-manager/metrics_collector"
"github.com/longhorn/longhorn-manager/types"
"github.com/longhorn/longhorn-manager/upgrade"
"github.com/longhorn/longhorn-manager/util"

metricsCollector "github.com/longhorn/longhorn-manager/metrics_collector"
)

const (
Expand Down
11 changes: 6 additions & 5 deletions controller/backing_image_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/kubernetes/pkg/controller"

corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/wait"
clientset "k8s.io/client-go/kubernetes"
typedv1core "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/kubernetes/pkg/controller"

"github.com/longhorn/longhorn-manager/constant"
"github.com/longhorn/longhorn-manager/datastore"
Expand Down
Loading

0 comments on commit acb922e

Please sign in to comment.