Skip to content

Commit

Permalink
The import package sort adjustment in the go file under the openyurt/…
Browse files Browse the repository at this point in the history
…pkg/yurthub-first (#588)
  • Loading branch information
yanyhui authored Nov 13, 2021
1 parent c7a66e2 commit 392fc5d
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 49 deletions.
4 changes: 2 additions & 2 deletions pkg/yurthub/cachemanager/cache_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package cachemanager
import (
"testing"

"github.com/openyurtio/openyurt/pkg/yurthub/util"

"k8s.io/apimachinery/pkg/util/sets"

"github.com/openyurtio/openyurt/pkg/yurthub/util"
)

func TestUpdateCacheAgents(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions pkg/yurthub/cachemanager/cache_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ import (
"strings"
"sync"

hubmeta "github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/meta"
"github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/serializer"
"github.com/openyurtio/openyurt/pkg/yurthub/storage"
"github.com/openyurtio/openyurt/pkg/yurthub/util"

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -46,6 +41,11 @@ import (
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/klog"

hubmeta "github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/meta"
"github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/serializer"
"github.com/openyurtio/openyurt/pkg/yurthub/storage"
"github.com/openyurtio/openyurt/pkg/yurthub/util"
)

// CacheManager is an adaptor to cache runtime object data into backend storage
Expand Down
16 changes: 8 additions & 8 deletions pkg/yurthub/cachemanager/cache_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ import (
"testing"
"time"

"github.com/openyurtio/openyurt/pkg/projectinfo"
hubmeta "github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/meta"
"github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/serializer"
proxyutil "github.com/openyurtio/openyurt/pkg/yurthub/proxy/util"
"github.com/openyurtio/openyurt/pkg/yurthub/storage"
"github.com/openyurtio/openyurt/pkg/yurthub/storage/disk"
"github.com/openyurtio/openyurt/pkg/yurthub/util"

v1 "k8s.io/api/core/v1"
nodev1beta1 "k8s.io/api/node/v1beta1"
"k8s.io/apimachinery/pkg/api/meta"
Expand All @@ -48,6 +40,14 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/apiserver/pkg/endpoints/filters"
"k8s.io/apiserver/pkg/endpoints/request"

"github.com/openyurtio/openyurt/pkg/projectinfo"
hubmeta "github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/meta"
"github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/serializer"
proxyutil "github.com/openyurtio/openyurt/pkg/yurthub/proxy/util"
"github.com/openyurtio/openyurt/pkg/yurthub/storage"
"github.com/openyurtio/openyurt/pkg/yurthub/storage/disk"
"github.com/openyurtio/openyurt/pkg/yurthub/util"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions pkg/yurthub/cachemanager/storage_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (
"bytes"
"sync"

"github.com/openyurtio/openyurt/pkg/yurthub/storage"
"github.com/openyurtio/openyurt/pkg/yurthub/util"

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer/json"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/klog"

"github.com/openyurtio/openyurt/pkg/yurthub/storage"
"github.com/openyurtio/openyurt/pkg/yurthub/util"
)

// StorageWrapper is wrapper for storage.Store interface
Expand Down
6 changes: 3 additions & 3 deletions pkg/yurthub/cachemanager/storage_wrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
"testing"
"time"

"github.com/openyurtio/openyurt/pkg/yurthub/storage"
"github.com/openyurtio/openyurt/pkg/yurthub/storage/disk"

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

"github.com/openyurtio/openyurt/pkg/yurthub/storage"
"github.com/openyurtio/openyurt/pkg/yurthub/storage/disk"
)

func clearDir(dir string) error {
Expand Down
6 changes: 3 additions & 3 deletions pkg/yurthub/certificate/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"sync"
"time"

"github.com/openyurtio/openyurt/cmd/yurthub/app/config"
"github.com/openyurtio/openyurt/pkg/yurthub/certificate/interfaces"

"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog"

"github.com/openyurtio/openyurt/cmd/yurthub/app/config"
"github.com/openyurtio/openyurt/pkg/yurthub/certificate/interfaces"
)

// Factory is a function that returns an YurtCertificateManager.
Expand Down
16 changes: 8 additions & 8 deletions pkg/yurthub/certificate/hubself/cert_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ import (
"strings"
"time"

"github.com/openyurtio/openyurt/cmd/yurthub/app/config"
"github.com/openyurtio/openyurt/pkg/projectinfo"
hubcert "github.com/openyurtio/openyurt/pkg/yurthub/certificate"
"github.com/openyurtio/openyurt/pkg/yurthub/certificate/interfaces"
"github.com/openyurtio/openyurt/pkg/yurthub/storage"
"github.com/openyurtio/openyurt/pkg/yurthub/storage/disk"
"github.com/openyurtio/openyurt/pkg/yurthub/util"

certificates "k8s.io/api/certificates/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
Expand All @@ -47,6 +39,14 @@ import (
certutil "k8s.io/client-go/util/cert"
"k8s.io/client-go/util/certificate"
"k8s.io/klog"

"github.com/openyurtio/openyurt/cmd/yurthub/app/config"
"github.com/openyurtio/openyurt/pkg/projectinfo"
hubcert "github.com/openyurtio/openyurt/pkg/yurthub/certificate"
"github.com/openyurtio/openyurt/pkg/yurthub/certificate/interfaces"
"github.com/openyurtio/openyurt/pkg/yurthub/storage"
"github.com/openyurtio/openyurt/pkg/yurthub/storage/disk"
"github.com/openyurtio/openyurt/pkg/yurthub/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/yurthub/certificate/hubself/fake_cert_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (
"fmt"
"path/filepath"

"k8s.io/klog"

"github.com/openyurtio/openyurt/cmd/yurthub/app/config"
"github.com/openyurtio/openyurt/pkg/projectinfo"
"github.com/openyurtio/openyurt/pkg/yurthub/certificate/interfaces"
"github.com/openyurtio/openyurt/pkg/yurthub/storage/disk"

"k8s.io/klog"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions pkg/yurthub/certificate/interfaces/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License.
package interfaces

import (
"github.com/openyurtio/openyurt/cmd/yurthub/app/config"

"k8s.io/client-go/util/certificate"

"github.com/openyurtio/openyurt/cmd/yurthub/app/config"
)

// YurtCertificateManager is responsible for managing node certificate for yurthub
Expand Down
6 changes: 3 additions & 3 deletions pkg/yurthub/certificate/kubelet/cert_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import (
"sync"
"time"

"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog"

"github.com/openyurtio/openyurt/cmd/yurthub/app/config"
"github.com/openyurtio/openyurt/pkg/yurthub/certificate"
"github.com/openyurtio/openyurt/pkg/yurthub/certificate/interfaces"
"github.com/openyurtio/openyurt/pkg/yurthub/util"

"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/yurthub/certificate/server/certmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"fmt"
"net"

"github.com/openyurtio/openyurt/pkg/projectinfo"

certificates "k8s.io/api/certificates/v1beta1"
"k8s.io/client-go/kubernetes"
clicert "k8s.io/client-go/kubernetes/typed/certificates/v1beta1"
"k8s.io/client-go/util/certificate"
"k8s.io/klog"

"github.com/openyurtio/openyurt/pkg/projectinfo"
)

const (
Expand Down
10 changes: 5 additions & 5 deletions pkg/yurthub/gc/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ import (
"fmt"
"time"

"github.com/openyurtio/openyurt/cmd/yurthub/app/config"
"github.com/openyurtio/openyurt/pkg/yurthub/cachemanager"
"github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/rest"
"github.com/openyurtio/openyurt/pkg/yurthub/util"

v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/util/wait"
clientset "k8s.io/client-go/kubernetes"
"k8s.io/klog"

"github.com/openyurtio/openyurt/cmd/yurthub/app/config"
"github.com/openyurtio/openyurt/pkg/yurthub/cachemanager"
"github.com/openyurtio/openyurt/pkg/yurthub/kubernetes/rest"
"github.com/openyurtio/openyurt/pkg/yurthub/util"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion pkg/yurthub/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package metrics
import (
"strings"

"github.com/openyurtio/openyurt/pkg/projectinfo"
"github.com/prometheus/client_golang/prometheus"

"github.com/openyurtio/openyurt/pkg/projectinfo"
)

var (
Expand Down
5 changes: 3 additions & 2 deletions pkg/yurthub/transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import (
"net/http"
"time"

"github.com/openyurtio/openyurt/pkg/yurthub/certificate/interfaces"
"github.com/openyurtio/openyurt/pkg/yurthub/util"
utilnet "k8s.io/apimachinery/pkg/util/net"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog"

"github.com/openyurtio/openyurt/pkg/yurthub/certificate/interfaces"
"github.com/openyurtio/openyurt/pkg/yurthub/util"
)

// Interface is an transport interface for managing clients that used to connecting kube-apiserver
Expand Down

0 comments on commit 392fc5d

Please sign in to comment.