mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
gofmt
This commit is contained in:
parent
c66a827c98
commit
6678a26d1c
5 changed files with 9 additions and 10 deletions
|
@ -449,7 +449,7 @@ func TestGetContainersChanges(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestGetContainersTop(t *testing.T) {
|
||||
t.Skip("Fixme. Skipping test for now. Reported error when testing using dind: 'api_test.go:527: Expected 2 processes, found 0.'")
|
||||
t.Skip("Fixme. Skipping test for now. Reported error when testing using dind: 'api_test.go:527: Expected 2 processes, found 0.'")
|
||||
runtime, err := newTestRuntime()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
10
container.go
10
container.go
|
@ -11,6 +11,7 @@ import (
|
|||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
|
@ -20,7 +21,6 @@ import (
|
|||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
"net"
|
||||
)
|
||||
|
||||
type Container struct {
|
||||
|
@ -813,10 +813,10 @@ func (container *Container) allocateNetwork() error {
|
|||
iface = &NetworkInterface{disabled: true}
|
||||
} else {
|
||||
iface = &NetworkInterface{
|
||||
IPNet: net.IPNet{IP: net.ParseIP(container.NetworkSettings.IPAddress), Mask: manager.bridgeNetwork.Mask},
|
||||
IPNet: net.IPNet{IP: net.ParseIP(container.NetworkSettings.IPAddress), Mask: manager.bridgeNetwork.Mask},
|
||||
Gateway: manager.bridgeNetwork.IP,
|
||||
manager: manager,
|
||||
}
|
||||
}
|
||||
ipNum := ipToInt(iface.IPNet.IP)
|
||||
manager.ipAllocator.inUse[ipNum] = struct{}{}
|
||||
}
|
||||
|
@ -827,10 +827,10 @@ func (container *Container) allocateNetwork() error {
|
|||
portSpecs = container.Config.PortSpecs
|
||||
} else {
|
||||
for backend, frontend := range container.NetworkSettings.PortMapping["Tcp"] {
|
||||
portSpecs = append(portSpecs, fmt.Sprintf("%s:%s/tcp",frontend, backend))
|
||||
portSpecs = append(portSpecs, fmt.Sprintf("%s:%s/tcp", frontend, backend))
|
||||
}
|
||||
for backend, frontend := range container.NetworkSettings.PortMapping["Udp"] {
|
||||
portSpecs = append(portSpecs, fmt.Sprintf("%s:%s/udp",frontend, backend))
|
||||
portSpecs = append(portSpecs, fmt.Sprintf("%s:%s/udp", frontend, backend))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -642,7 +642,7 @@ func (manager *NetworkManager) Allocate() (*NetworkInterface, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// avoid duplicate IP
|
||||
// avoid duplicate IP
|
||||
ipNum := ipToInt(ip)
|
||||
firstIP := manager.ipAllocator.network.IP.To4().Mask(manager.ipAllocator.network.Mask)
|
||||
firstIPNum := ipToInt(firstIP) + 1
|
||||
|
|
|
@ -679,7 +679,7 @@ func (srv *Server) getImageList(localRepo map[string]string) ([][]*registry.ImgD
|
|||
depGraph.NewNode(img.ID)
|
||||
img.WalkHistory(func(current *Image) error {
|
||||
imgList[current.ID] = ®istry.ImgData{
|
||||
ID: current.ID,
|
||||
ID: current.ID,
|
||||
Tag: tag,
|
||||
}
|
||||
parent, err := current.GetParent()
|
||||
|
|
|
@ -366,7 +366,6 @@ func TestParseRelease(t *testing.T) {
|
|||
assertParseRelease(t, "3.8.0-19-generic", &KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0, Flavor: "19-generic"}, 0)
|
||||
}
|
||||
|
||||
|
||||
func TestDependencyGraphCircular(t *testing.T) {
|
||||
g1 := NewDependencyGraph()
|
||||
a := g1.NewNode("a")
|
||||
|
@ -421,4 +420,4 @@ func TestDependencyGraph(t *testing.T) {
|
|||
if len(res[2]) != 1 || res[2][0] != "d" {
|
||||
t.Fatalf("Expected [d], found %v instead", res[2])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue