Skip to content

Commit

Permalink
refactor: reorder import
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Yu <[email protected]>
  • Loading branch information
Yu-Jack authored and starbops committed Jan 22, 2024
1 parent 0176ab2 commit 0b96356
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 21 deletions.
15 changes: 7 additions & 8 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import (
"fmt"
"os"

ctlcni "github.com/harvester/harvester/pkg/generated/controllers/k8s.cni.cncf.io"
ctlcniv1 "github.com/harvester/harvester/pkg/generated/controllers/k8s.cni.cncf.io/v1"
ctlkubevirt "github.com/harvester/harvester/pkg/generated/controllers/kubevirt.io"
ctlkubevirtv1 "github.com/harvester/harvester/pkg/generated/controllers/kubevirt.io/v1"
"github.com/harvester/harvester/pkg/indexeres"
"github.com/harvester/webhook/pkg/config"
"github.com/harvester/webhook/pkg/server"
ctlcore "github.com/rancher/wrangler/pkg/generated/controllers/core"
ctlcorev1 "github.com/rancher/wrangler/pkg/generated/controllers/core/v1"
"github.com/rancher/wrangler/pkg/kubeconfig"
Expand All @@ -15,14 +22,6 @@ import (
"k8s.io/client-go/rest"
kubevirtv1 "kubevirt.io/api/core/v1"

ctlcni "github.com/harvester/harvester/pkg/generated/controllers/k8s.cni.cncf.io"
ctlcniv1 "github.com/harvester/harvester/pkg/generated/controllers/k8s.cni.cncf.io/v1"
ctlkubevirt "github.com/harvester/harvester/pkg/generated/controllers/kubevirt.io"
ctlkubevirtv1 "github.com/harvester/harvester/pkg/generated/controllers/kubevirt.io/v1"
"github.com/harvester/harvester/pkg/indexeres"
"github.com/harvester/webhook/pkg/config"
"github.com/harvester/webhook/pkg/server"

ctlnetwork "github.com/harvester/harvester-network-controller/pkg/generated/controllers/network.harvesterhci.io"
ctlnetworkv1 "github.com/harvester/harvester-network-controller/pkg/generated/controllers/network.harvesterhci.io/v1beta1"
"github.com/harvester/harvester-network-controller/pkg/webhook/clusternetwork"
Expand Down
3 changes: 1 addition & 2 deletions pkg/webhook/clusternetwork/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ package clusternetwork
import (
"fmt"

"github.com/harvester/webhook/pkg/server/admission"
admissionregv1 "k8s.io/api/admissionregistration/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"

"github.com/harvester/webhook/pkg/server/admission"

networkv1 "github.com/harvester/harvester-network-controller/pkg/apis/network.harvesterhci.io/v1beta1"
ctlnetworkv1 "github.com/harvester/harvester-network-controller/pkg/generated/controllers/network.harvesterhci.io/v1beta1"
"github.com/harvester/harvester-network-controller/pkg/utils"
Expand Down
3 changes: 1 addition & 2 deletions pkg/webhook/nad/mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import (
"reflect"
"strconv"

"github.com/harvester/webhook/pkg/server/admission"
cniv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
"github.com/tidwall/sjson"
admissionregv1 "k8s.io/api/admissionregistration/v1"
k8slabels "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog"

"github.com/harvester/webhook/pkg/server/admission"

networkv1 "github.com/harvester/harvester-network-controller/pkg/apis/network.harvesterhci.io/v1beta1"
ctlnetworkv1 "github.com/harvester/harvester-network-controller/pkg/generated/controllers/network.harvesterhci.io/v1beta1"
"github.com/harvester/harvester-network-controller/pkg/network/iface"
Expand Down
5 changes: 2 additions & 3 deletions pkg/webhook/nad/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import (
"reflect"
"strings"

ctlkubevirtv1 "github.com/harvester/harvester/pkg/generated/controllers/kubevirt.io/v1"
"github.com/harvester/webhook/pkg/server/admission"
cniv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
admissionregv1 "k8s.io/api/admissionregistration/v1"
"k8s.io/apimachinery/pkg/runtime"

ctlkubevirtv1 "github.com/harvester/harvester/pkg/generated/controllers/kubevirt.io/v1"
"github.com/harvester/webhook/pkg/server/admission"

"github.com/harvester/harvester-network-controller/pkg/network/iface"
"github.com/harvester/harvester-network-controller/pkg/utils"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/webhook/vlanconfig/mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import (
"fmt"
"reflect"

"github.com/harvester/webhook/pkg/server/admission"
ctlcorev1 "github.com/rancher/wrangler/pkg/generated/controllers/core/v1"
admissionregv1 "k8s.io/api/admissionregistration/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"

"github.com/harvester/webhook/pkg/server/admission"

networkv1 "github.com/harvester/harvester-network-controller/pkg/apis/network.harvesterhci.io/v1beta1"
"github.com/harvester/harvester-network-controller/pkg/utils"
)
Expand Down
7 changes: 3 additions & 4 deletions pkg/webhook/vlanconfig/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ import (
"strings"

mapset "github.com/deckarep/golang-set/v2"
ctlcniv1 "github.com/harvester/harvester/pkg/generated/controllers/k8s.cni.cncf.io/v1"
ctlkubevirtv1 "github.com/harvester/harvester/pkg/generated/controllers/kubevirt.io/v1"
"github.com/harvester/webhook/pkg/server/admission"
admissionregv1 "k8s.io/api/admissionregistration/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
kubevirtv1 "kubevirt.io/api/core/v1"

ctlcniv1 "github.com/harvester/harvester/pkg/generated/controllers/k8s.cni.cncf.io/v1"
ctlkubevirtv1 "github.com/harvester/harvester/pkg/generated/controllers/kubevirt.io/v1"
"github.com/harvester/webhook/pkg/server/admission"

networkv1 "github.com/harvester/harvester-network-controller/pkg/apis/network.harvesterhci.io/v1beta1"
ctlnetworkv1 "github.com/harvester/harvester-network-controller/pkg/generated/controllers/network.harvesterhci.io/v1beta1"
"github.com/harvester/harvester-network-controller/pkg/network/iface"
Expand Down

0 comments on commit 0b96356

Please sign in to comment.