Bläddra i källkod

goimports and removing more init funcs with just logs

Luther Monson 3 år sedan
förälder
incheckning
65edc01ef7

+ 1 - 1
backend/alivpc/alivpc.go

@@ -18,7 +18,6 @@ package alivpc
 import (
 	"encoding/json"
 	"fmt"
-	"golang.org/x/net/context"
 	"os"
 	"sync"
 
@@ -28,6 +27,7 @@ import (
 	"github.com/flannel-io/flannel/backend"
 	"github.com/flannel-io/flannel/pkg/ip"
 	"github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 	log "k8s.io/klog"
 )
 

+ 0 - 8
backend/alivpc/alivpc_windows.go

@@ -13,11 +13,3 @@
 // limitations under the License.
 
 package alivpc
-
-import (
-	log "k8s.io/klog"
-)
-
-func init() {
-	log.Infof("AliVpc is not supported on this platform")
-}

+ 1 - 2
backend/awsvpc/awsvpc.go

@@ -26,11 +26,10 @@ import (
 	"github.com/aws/aws-sdk-go/aws/ec2metadata"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/backend"
 	"github.com/flannel-io/flannel/pkg/ip"
 	"github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 	log "k8s.io/klog"
 )
 

+ 0 - 8
backend/awsvpc/awsvpc_windows.go

@@ -13,11 +13,3 @@
 // limitations under the License.
 
 package awsvpc
-
-import (
-	log "k8s.io/klog"
-)
-
-func init() {
-	log.Infof("AWS VPC is not supported on this platform")
-}

+ 1 - 2
backend/common.go

@@ -18,9 +18,8 @@ import (
 	"net"
 	"sync"
 
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 )
 
 type ExternalInterface struct {

+ 0 - 8
backend/gce/gce_windows.go

@@ -36,11 +36,3 @@
 // SOFTWARE.
 
 package gce
-
-import (
-	log "k8s.io/klog"
-)
-
-func init() {
-	log.Infof("GCE is not supported on this platform")
-}

+ 0 - 1
backend/hostgw/hostgw.go

@@ -19,7 +19,6 @@ package hostgw
 
 import (
 	"fmt"
-
 	"sync"
 
 	"github.com/flannel-io/flannel/backend"

+ 0 - 8
backend/ipip/ipip_windows.go

@@ -14,11 +14,3 @@
 // +build windows
 
 package ipip
-
-import (
-	log "k8s.io/klog"
-)
-
-func init() {
-	log.Infof("ipip is not supported on this platform")
-}

+ 1 - 2
backend/manager.go

@@ -19,9 +19,8 @@ import (
 	"strings"
 	"sync"
 
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 )
 
 var constructors = make(map[string]BackendCtor)

+ 1 - 2
backend/route_network.go

@@ -22,10 +22,9 @@ import (
 	"sync"
 	"time"
 
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/subnet"
 	"github.com/vishvananda/netlink"
+	"golang.org/x/net/context"
 	log "k8s.io/klog"
 )
 

+ 1 - 2
backend/route_network_windows.go

@@ -19,10 +19,9 @@ import (
 	"sync"
 	"time"
 
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/pkg/routing"
 	"github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 	log "k8s.io/klog"
 )
 

+ 1 - 2
backend/simple_network.go

@@ -15,9 +15,8 @@
 package backend
 
 import (
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 )
 
 type SimpleNetwork struct {

+ 0 - 8
backend/tencentvpc/tencentvpc_windows.go

@@ -13,11 +13,3 @@
 // limitations under the License.
 
 package tencentvpc
-
-import (
-	log "k8s.io/klog"
-)
-
-func init() {
-	log.Infof("TencentVpc is not supported on this platform")
-}

+ 1 - 2
backend/udp/udp_amd64.go

@@ -20,11 +20,10 @@ import (
 	"fmt"
 	"sync"
 
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/backend"
 	"github.com/flannel-io/flannel/pkg/ip"
 	"github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 )
 
 func init() {

+ 1 - 2
backend/udp/udp_network_amd64.go

@@ -24,12 +24,11 @@ import (
 	"sync"
 	"syscall"
 
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/backend"
 	"github.com/flannel-io/flannel/pkg/ip"
 	"github.com/flannel-io/flannel/subnet"
 	"github.com/vishvananda/netlink"
+	"golang.org/x/net/context"
 	log "k8s.io/klog"
 )
 

+ 0 - 8
backend/udp/udp_windows.go

@@ -13,11 +13,3 @@
 // limitations under the License.
 
 package udp
-
-import (
-	log "k8s.io/klog"
-)
-
-func init() {
-	log.Infof("udp is not supported on this platform")
-}

+ 1 - 2
backend/vxlan/vxlan.go

@@ -58,11 +58,10 @@ import (
 	"net"
 	"sync"
 
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/backend"
 	"github.com/flannel-io/flannel/pkg/ip"
 	"github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 	log "k8s.io/klog"
 )
 

+ 1 - 2
backend/vxlan/vxlan_network.go

@@ -21,12 +21,11 @@ import (
 	"sync"
 	"syscall"
 
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/backend"
 	"github.com/flannel-io/flannel/pkg/ip"
 	"github.com/flannel-io/flannel/subnet"
 	"github.com/vishvananda/netlink"
+	"golang.org/x/net/context"
 	log "k8s.io/klog"
 )
 

+ 1 - 2
backend/vxlan/vxlan_network_windows.go

@@ -20,12 +20,11 @@ import (
 	"strings"
 	"sync"
 
-	"golang.org/x/net/context"
-
 	"github.com/Microsoft/hcsshim/hcn"
 	"github.com/flannel-io/flannel/backend"
 	"github.com/flannel-io/flannel/pkg/ip"
 	"github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 	log "k8s.io/klog"
 )
 

+ 1 - 2
backend/vxlan/vxlan_windows.go

@@ -30,12 +30,11 @@ import (
 	"net"
 	"sync"
 
-	"golang.org/x/net/context"
-
 	"github.com/Microsoft/hcsshim/hcn"
 	"github.com/flannel-io/flannel/backend"
 	"github.com/flannel-io/flannel/pkg/ip"
 	"github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 	log "k8s.io/klog"
 )
 

+ 2 - 3
subnet/etcdv2/mock_registry.go

@@ -20,11 +20,10 @@ import (
 	"time"
 
 	etcd "github.com/coreos/etcd/client"
-	"github.com/jonboulle/clockwork"
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/pkg/ip"
 	. "github.com/flannel-io/flannel/subnet"
+	"github.com/jonboulle/clockwork"
+	"golang.org/x/net/context"
 )
 
 var clock clockwork.Clock = clockwork.NewRealClock()

+ 1 - 2
subnet/etcdv2/registry_test.go

@@ -21,10 +21,9 @@ import (
 	"time"
 
 	etcd "github.com/coreos/etcd/client"
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/pkg/ip"
 	. "github.com/flannel-io/flannel/subnet"
+	"golang.org/x/net/context"
 )
 
 func newTestEtcdRegistry(t *testing.T) (Registry, *mockEtcd) {

+ 1 - 2
subnet/watch.go

@@ -17,9 +17,8 @@ package subnet
 import (
 	"time"
 
-	"golang.org/x/net/context"
-
 	"github.com/flannel-io/flannel/pkg/ip"
+	"golang.org/x/net/context"
 	log "k8s.io/klog"
 )
 

+ 1 - 1
version/version.go

@@ -14,4 +14,4 @@
 
 package version
 
-var Version = "0.5.3+git"
+var Version = "dev"