refactor: make proxy log via a package-local var
which gets rid of a bunch of (dot) imports.
This commit is contained in:
1 parent
6e4f025d9c
commit
c25bfafcb2
7 files changed
+6
-12
No files matched your search
+3
-1
@@ -12,7 +12,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/fsouza/go-dockerclient"
|
||||
. "github.com/weaveworks/weave/common"
|
||||
"github.com/weaveworks/weave/common"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -20,6 +20,8 @@ var (
|
||||
weaveWaitEntrypoint = []string{"/w/w"}
|
||||
weaveEntrypoint = "/home/weave/weaver"
|
||||
weaveContainerName = "/weave"
|
||||
|
||||
Log = common.Log
|
||||
)
|
||||
|
||||
func callWeave(args ...string) ([]byte, []byte, error) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/fsouza/go-dockerclient"
|
||||
. "github.com/weaveworks/weave/common"
|
||||
)
|
||||
|
||||
const MaxDockerHostname = 64
|
||||
|
||||
@@ -3,8 +3,6 @@ package proxy
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
. "github.com/weaveworks/weave/common"
|
||||
)
|
||||
|
||||
type createExecInterceptor struct{ proxy *Proxy }
|
||||
|
||||
@@ -2,8 +2,6 @@ package proxy
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
. "github.com/weaveworks/weave/common"
|
||||
)
|
||||
|
||||
type inspectContainerInterceptor struct{ proxy *Proxy }
|
||||
|
||||
@@ -2,8 +2,6 @@ package proxy
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
. "github.com/weaveworks/weave/common"
|
||||
)
|
||||
|
||||
type inspectExecInterceptor struct{ proxy *Proxy }
|
||||
|
||||
+3
-3
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
docker "github.com/fsouza/go-dockerclient"
|
||||
weaveapi "github.com/weaveworks/weave/api"
|
||||
. "github.com/weaveworks/weave/common"
|
||||
"github.com/weaveworks/weave/common"
|
||||
weavedocker "github.com/weaveworks/weave/common/docker"
|
||||
weavenet "github.com/weaveworks/weave/net"
|
||||
)
|
||||
@@ -148,7 +148,7 @@ func NewProxy(c Config) (*Proxy, error) {
|
||||
p.client = client.Client
|
||||
|
||||
if !p.WithoutDNS {
|
||||
netDevs, err := GetBridgeNetDev(c.DockerBridge)
|
||||
netDevs, err := common.GetBridgeNetDev(c.DockerBridge)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -582,7 +582,7 @@ func (proxy *Proxy) updateContainerNetworkSettings(container jsonObject) error {
|
||||
if err := proxy.waitForStartByIdent(containerID); err != nil {
|
||||
return err
|
||||
}
|
||||
netDevs, err := GetWeaveNetDevs(pid)
|
||||
netDevs, err := common.GetWeaveNetDevs(pid)
|
||||
if err != nil || len(netDevs) == 0 || len(netDevs[0].CIDRs) == 0 {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/fsouza/go-dockerclient"
|
||||
. "github.com/weaveworks/weave/common"
|
||||
)
|
||||
|
||||
func (proxy *Proxy) Intercept(i interceptor, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in new issue
Block a user