Skip to content

Commit

Permalink
golangci fix
Browse files Browse the repository at this point in the history
Signed-off-by: Hang Yan <[email protected]>
  • Loading branch information
hangyan committed Dec 22, 2023
1 parent 0e20a03 commit f676355
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 26 deletions.
3 changes: 2 additions & 1 deletion cmd/antrea-agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
package main

import (
"antrea.io/antrea/pkg/agent/controller/packetsampling"
"context"
"fmt"
"net"
"time"

"antrea.io/antrea/pkg/agent/controller/packetsampling"

"github.com/spf13/afero"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
Expand Down
3 changes: 2 additions & 1 deletion cmd/antrea-controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
package main

import (
"antrea.io/antrea/pkg/controller/packetsampling"
"context"
"fmt"
"net"
"os"
"path"
"time"

"antrea.io/antrea/pkg/controller/packetsampling"

apiextensionclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
Expand Down
6 changes: 4 additions & 2 deletions pkg/agent/controller/packetsampling/packetin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
package packetsampling

import (
"antrea.io/antrea/pkg/util/compress"
"context"
"errors"
"fmt"
"github.com/spf13/afero"
"time"

"github.com/spf13/afero"

"antrea.io/antrea/pkg/util/compress"

"antrea.io/libOpenflow/protocol"
"antrea.io/libOpenflow/util"
"antrea.io/ofnet/ofctrl"
Expand Down
37 changes: 20 additions & 17 deletions pkg/agent/controller/packetsampling/packetsampling_controller.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
package packetsampling

import (
"antrea.io/antrea/pkg/agent/util"
"antrea.io/antrea/pkg/apis/controlplane"
binding "antrea.io/antrea/pkg/ovs/openflow"
"antrea.io/libOpenflow/protocol"
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"github.com/google/gopacket/layers"
"github.com/pkg/sftp"
"github.com/spf13/afero"
"golang.org/x/crypto/ssh"
"io"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
coreinformers "k8s.io/client-go/informers/core/v1"
"net"
"net/url"
"os"
Expand All @@ -27,11 +15,31 @@ import (
"sync"
"time"

"antrea.io/libOpenflow/protocol"
"github.com/google/gopacket/layers"
"github.com/pkg/sftp"
"github.com/spf13/afero"
"golang.org/x/crypto/ssh"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
coreinformers "k8s.io/client-go/informers/core/v1"

"antrea.io/antrea/pkg/agent/util"
"antrea.io/antrea/pkg/apis/controlplane"
binding "antrea.io/antrea/pkg/ovs/openflow"

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

"github.com/google/gopacket/pcapgo"
"golang.org/x/time/rate"

clientset "k8s.io/client-go/kubernetes"
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
"k8s.io/klog/v2"

"antrea.io/antrea/pkg/agent/config"
"antrea.io/antrea/pkg/agent/interfacestore"
"antrea.io/antrea/pkg/agent/openflow"
Expand All @@ -41,11 +49,6 @@ import (
crdlisters "antrea.io/antrea/pkg/client/listers/crd/v1alpha1"
"antrea.io/antrea/pkg/features"
"antrea.io/antrea/pkg/ovs/ovsconfig"
clientset "k8s.io/client-go/kubernetes"
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
"k8s.io/klog/v2"
)

type ProtocolType string
Expand Down
3 changes: 2 additions & 1 deletion pkg/agent/openflow/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
package openflow

import (
"antrea.io/antrea/pkg/agent/metrics"
"fmt"
"math/rand"
"net"

"antrea.io/antrea/pkg/agent/metrics"

"antrea.io/libOpenflow/openflow15"
"antrea.io/libOpenflow/protocol"
ofutil "antrea.io/libOpenflow/util"
Expand Down
3 changes: 2 additions & 1 deletion pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
package apiserver

import (
"antrea.io/antrea/pkg/controller/packetsampling"
"context"
"time"

"antrea.io/antrea/pkg/controller/packetsampling"

apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
6 changes: 4 additions & 2 deletions pkg/controller/packetsampling/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"

crdv1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1"
"k8s.io/apimachinery/pkg/util/wait"
coreinformers "k8s.io/client-go/informers/core/v1"
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/klog/v2"

crdv1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1"

"k8s.io/client-go/tools/cache"

"antrea.io/antrea/pkg/client/clientset/versioned"
crdinformers "antrea.io/antrea/pkg/client/informers/externalversions/crd/v1alpha1"
crdlisters "antrea.io/antrea/pkg/client/listers/crd/v1alpha1"
"k8s.io/client-go/tools/cache"

"k8s.io/client-go/util/workqueue"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/packetsampling/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
package packetsampling

import (
crdv1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1"
"encoding/json"
"fmt"

crdv1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1"

admv1 "k8s.io/api/admission/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
Expand Down

0 comments on commit f676355

Please sign in to comment.