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"
|
"strings"
|
||||||
|
|
||||||
"github.com/fsouza/go-dockerclient"
|
"github.com/fsouza/go-dockerclient"
|
||||||
. "github.com/weaveworks/weave/common"
|
"github.com/weaveworks/weave/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -20,6 +20,8 @@ var (
|
|||||||
weaveWaitEntrypoint = []string{"/w/w"}
|
weaveWaitEntrypoint = []string{"/w/w"}
|
||||||
weaveEntrypoint = "/home/weave/weaver"
|
weaveEntrypoint = "/home/weave/weaver"
|
||||||
weaveContainerName = "/weave"
|
weaveContainerName = "/weave"
|
||||||
|
|
||||||
|
Log = common.Log
|
||||||
)
|
)
|
||||||
|
|
||||||
func callWeave(args ...string) ([]byte, []byte, error) {
|
func callWeave(args ...string) ([]byte, []byte, error) {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/fsouza/go-dockerclient"
|
"github.com/fsouza/go-dockerclient"
|
||||||
. "github.com/weaveworks/weave/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const MaxDockerHostname = 64
|
const MaxDockerHostname = 64
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package proxy
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
. "github.com/weaveworks/weave/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type createExecInterceptor struct{ proxy *Proxy }
|
type createExecInterceptor struct{ proxy *Proxy }
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package proxy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
. "github.com/weaveworks/weave/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type inspectContainerInterceptor struct{ proxy *Proxy }
|
type inspectContainerInterceptor struct{ proxy *Proxy }
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package proxy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
. "github.com/weaveworks/weave/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type inspectExecInterceptor struct{ proxy *Proxy }
|
type inspectExecInterceptor struct{ proxy *Proxy }
|
||||||
|
|||||||
+3
-3
@@ -17,7 +17,7 @@ import (
|
|||||||
|
|
||||||
docker "github.com/fsouza/go-dockerclient"
|
docker "github.com/fsouza/go-dockerclient"
|
||||||
weaveapi "github.com/weaveworks/weave/api"
|
weaveapi "github.com/weaveworks/weave/api"
|
||||||
. "github.com/weaveworks/weave/common"
|
"github.com/weaveworks/weave/common"
|
||||||
weavedocker "github.com/weaveworks/weave/common/docker"
|
weavedocker "github.com/weaveworks/weave/common/docker"
|
||||||
weavenet "github.com/weaveworks/weave/net"
|
weavenet "github.com/weaveworks/weave/net"
|
||||||
)
|
)
|
||||||
@@ -148,7 +148,7 @@ func NewProxy(c Config) (*Proxy, error) {
|
|||||||
p.client = client.Client
|
p.client = client.Client
|
||||||
|
|
||||||
if !p.WithoutDNS {
|
if !p.WithoutDNS {
|
||||||
netDevs, err := GetBridgeNetDev(c.DockerBridge)
|
netDevs, err := common.GetBridgeNetDev(c.DockerBridge)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -582,7 +582,7 @@ func (proxy *Proxy) updateContainerNetworkSettings(container jsonObject) error {
|
|||||||
if err := proxy.waitForStartByIdent(containerID); err != nil {
|
if err := proxy.waitForStartByIdent(containerID); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
netDevs, err := GetWeaveNetDevs(pid)
|
netDevs, err := common.GetWeaveNetDevs(pid)
|
||||||
if err != nil || len(netDevs) == 0 || len(netDevs[0].CIDRs) == 0 {
|
if err != nil || len(netDevs) == 0 || len(netDevs[0].CIDRs) == 0 {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/fsouza/go-dockerclient"
|
"github.com/fsouza/go-dockerclient"
|
||||||
. "github.com/weaveworks/weave/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (proxy *Proxy) Intercept(i interceptor, w http.ResponseWriter, r *http.Request) {
|
func (proxy *Proxy) Intercept(i interceptor, w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
Reference in new issue
Block a user