libnetwork/etchosts/etchosts_test.go:167:54: empty-lines: extra empty line at the end of a block (revive)
libnetwork/osl/route_linux.go:185:74: empty-lines: extra empty line at the start of a block (revive)
libnetwork/osl/sandbox_linux_test.go:323:36: empty-lines: extra empty line at the start of a block (revive)
libnetwork/bitseq/sequence.go:412:48: empty-lines: extra empty line at the start of a block (revive)
libnetwork/datastore/datastore_test.go:67:46: empty-lines: extra empty line at the end of a block (revive)
libnetwork/datastore/mock_store.go:34:60: empty-lines: extra empty line at the end of a block (revive)
libnetwork/iptables/firewalld.go:202:44: empty-lines: extra empty line at the end of a block (revive)
libnetwork/iptables/firewalld_test.go:76:36: empty-lines: extra empty line at the end of a block (revive)
libnetwork/iptables/iptables.go:256:67: empty-lines: extra empty line at the end of a block (revive)
libnetwork/iptables/iptables.go:303:128: empty-lines: extra empty line at the start of a block (revive)
libnetwork/networkdb/cluster.go:183:72: empty-lines: extra empty line at the end of a block (revive)
libnetwork/ipams/null/null_test.go:44:38: empty-lines: extra empty line at the end of a block (revive)
libnetwork/drivers/macvlan/macvlan_store.go:45:52: empty-lines: extra empty line at the end of a block (revive)
libnetwork/ipam/allocator_test.go:1058:39: empty-lines: extra empty line at the start of a block (revive)
libnetwork/drivers/bridge/port_mapping.go:88:111: empty-lines: extra empty line at the end of a block (revive)
libnetwork/drivers/bridge/link.go:26:90: empty-lines: extra empty line at the end of a block (revive)
libnetwork/drivers/bridge/setup_ipv6_test.go:17:34: empty-lines: extra empty line at the end of a block (revive)
libnetwork/drivers/bridge/setup_ip_tables.go:392:4: empty-lines: extra empty line at the start of a block (revive)
libnetwork/drivers/bridge/bridge.go:804:50: empty-lines: extra empty line at the start of a block (revive)
libnetwork/drivers/overlay/ov_serf.go:183:29: empty-lines: extra empty line at the start of a block (revive)
libnetwork/drivers/overlay/ov_utils.go:81:64: empty-lines: extra empty line at the end of a block (revive)
libnetwork/drivers/overlay/peerdb.go:172:67: empty-lines: extra empty line at the start of a block (revive)
libnetwork/drivers/overlay/peerdb.go:209:67: empty-lines: extra empty line at the start of a block (revive)
libnetwork/drivers/overlay/peerdb.go:344:89: empty-lines: extra empty line at the start of a block (revive)
libnetwork/drivers/overlay/peerdb.go:436:63: empty-lines: extra empty line at the start of a block (revive)
libnetwork/drivers/overlay/overlay.go:183:36: empty-lines: extra empty line at the start of a block (revive)
libnetwork/drivers/overlay/encryption.go:69:28: empty-lines: extra empty line at the end of a block (revive)
libnetwork/drivers/overlay/ov_network.go:563:81: empty-lines: extra empty line at the start of a block (revive)
libnetwork/default_gateway.go:32:43: empty-lines: extra empty line at the start of a block (revive)
libnetwork/errors_test.go:9:40: empty-lines: extra empty line at the start of a block (revive)
libnetwork/service_common.go:184:64: empty-lines: extra empty line at the end of a block (revive)
libnetwork/endpoint.go:161:55: empty-lines: extra empty line at the end of a block (revive)
libnetwork/store.go:320:33: empty-lines: extra empty line at the end of a block (revive)
libnetwork/store_linux_test.go:11:38: empty-lines: extra empty line at the end of a block (revive)
libnetwork/sandbox.go:571:36: empty-lines: extra empty line at the start of a block (revive)
libnetwork/service_common.go:317:246: empty-lines: extra empty line at the start of a block (revive)
libnetwork/endpoint.go:550:17: empty-lines: extra empty line at the end of a block (revive)
libnetwork/sandbox_dns_unix.go:213:106: empty-lines: extra empty line at the start of a block (revive)
libnetwork/controller.go:676:85: empty-lines: extra empty line at the end of a block (revive)
libnetwork/agent.go:876:60: empty-lines: extra empty line at the end of a block (revive)
libnetwork/resolver.go:324:69: empty-lines: extra empty line at the end of a block (revive)
libnetwork/network.go:1153:92: empty-lines: extra empty line at the end of a block (revive)
libnetwork/network.go:1955:67: empty-lines: extra empty line at the start of a block (revive)
libnetwork/network.go:2235:9: empty-lines: extra empty line at the start of a block (revive)
libnetwork/libnetwork_internal_test.go:336:26: empty-lines: extra empty line at the start of a block (revive)
libnetwork/resolver_test.go:76:35: empty-lines: extra empty line at the end of a block (revive)
libnetwork/libnetwork_test.go:303:38: empty-lines: extra empty line at the end of a block (revive)
libnetwork/libnetwork_test.go:985:46: empty-lines: extra empty line at the end of a block (revive)
libnetwork/ipam/allocator_test.go:1263:37: empty-lines: extra empty line at the start of a block (revive)
libnetwork/errors_test.go:9:40: empty-lines: extra empty line at the end of a block (revive)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -675,7 +675,6 @@ func (c *controller) NewNetwork(networkType, name string, id string, options ... |
| 675 | 675 |
|
| 676 | 676 |
if network.scope == datastore.LocalScope && cap.DataScope == datastore.GlobalScope {
|
| 677 | 677 |
return nil, types.ForbiddenErrorf("cannot downgrade network scope for %s networks", networkType)
|
| 678 |
- |
|
| 679 | 678 |
} |
| 680 | 679 |
if network.ingress && cap.DataScope != datastore.GlobalScope {
|
| 681 | 680 |
return nil, types.ForbiddenErrorf("Ingress network can only be global scope network")
|
| ... | ... |
@@ -86,7 +86,7 @@ func (n *bridgeNetwork) allocatePortsInternal(bindings []types.PortBinding, cont |
| 86 | 86 |
// validatePortBindingIPv4 validates the port binding, populates the missing Host IP field and returns true |
| 87 | 87 |
// if this is a valid IPv4 binding, else returns false |
| 88 | 88 |
func (n *bridgeNetwork) validatePortBindingIPv4(bnd *types.PortBinding, containerIPv4, defHostIP net.IP) bool {
|
| 89 |
- //Return early if there is a valid Host IP, but its not a IPv4 address |
|
| 89 |
+ // Return early if there is a valid Host IP, but its not a IPv4 address |
|
| 90 | 90 |
if len(bnd.HostIP) > 0 && bnd.HostIP.To4() == nil {
|
| 91 | 91 |
return false |
| 92 | 92 |
} |
| ... | ... |
@@ -100,7 +100,6 @@ func (n *bridgeNetwork) validatePortBindingIPv4(bnd *types.PortBinding, containe |
| 100 | 100 |
} |
| 101 | 101 |
bnd.IP = containerIPv4 |
| 102 | 102 |
return true |
| 103 |
- |
|
| 104 | 103 |
} |
| 105 | 104 |
|
| 106 | 105 |
// validatePortBindingIPv6 validates the port binding, populates the missing Host IP field and returns true |
| ... | ... |
@@ -390,7 +390,6 @@ func removeIPChains(version iptables.IPVersion) {
|
| 390 | 390 |
{Name: IsolationChain2, Table: iptables.Filter, IPTable: ipt},
|
| 391 | 391 |
{Name: oldIsolationChain, Table: iptables.Filter, IPTable: ipt},
|
| 392 | 392 |
} {
|
| 393 |
- |
|
| 394 | 393 |
if err := chainInfo.Remove(); err != nil {
|
| 395 | 394 |
logrus.Warnf("Failed to remove existing iptables entries in table %s chain %s : %v", chainInfo.Table, chainInfo.Name, err)
|
| 396 | 395 |
} |
| ... | ... |
@@ -10,11 +10,10 @@ import ( |
| 10 | 10 |
"fmt" |
| 11 | 11 |
"hash/fnv" |
| 12 | 12 |
"net" |
| 13 |
+ "strconv" |
|
| 13 | 14 |
"sync" |
| 14 | 15 |
"syscall" |
| 15 | 16 |
|
| 16 |
- "strconv" |
|
| 17 |
- |
|
| 18 | 17 |
"github.com/docker/docker/libnetwork/drivers/overlay/overlayutils" |
| 19 | 18 |
"github.com/docker/docker/libnetwork/iptables" |
| 20 | 19 |
"github.com/docker/docker/libnetwork/ns" |
| ... | ... |
@@ -76,7 +75,6 @@ func (e *encrMap) String() string {
|
| 76 | 76 |
b.WriteString(",")
|
| 77 | 77 |
} |
| 78 | 78 |
b.WriteString("]")
|
| 79 |
- |
|
| 80 | 79 |
} |
| 81 | 80 |
return b.String() |
| 82 | 81 |
} |
| ... | ... |
@@ -561,7 +561,6 @@ func (n *network) restoreSubnetSandbox(s *subnet, brName, vxlanName string) erro |
| 561 | 561 |
} |
| 562 | 562 |
|
| 563 | 563 |
func (n *network) setupSubnetSandbox(s *subnet, brName, vxlanName string) error {
|
| 564 |
- |
|
| 565 | 564 |
if hostMode {
|
| 566 | 565 |
// Try to delete stale bridge interface if it exists |
| 567 | 566 |
if err := deleteInterface(brName); err != nil {
|
| ... | ... |
@@ -1076,7 +1075,7 @@ func (n *network) releaseVxlanID() ([]uint32, error) {
|
| 1076 | 1076 |
} |
| 1077 | 1077 |
|
| 1078 | 1078 |
func (n *network) obtainVxlanID(s *subnet) error {
|
| 1079 |
- //return if the subnet already has a vxlan id assigned |
|
| 1079 |
+ // return if the subnet already has a vxlan id assigned |
|
| 1080 | 1080 |
if n.vxlanID(s) != 0 {
|
| 1081 | 1081 |
return nil |
| 1082 | 1082 |
} |
| ... | ... |
@@ -179,9 +179,7 @@ func (d *driver) resolvePeer(nid string, peerIP net.IP) (net.HardwareAddr, net.I |
| 179 | 179 |
} |
| 180 | 180 |
} |
| 181 | 181 |
|
| 182 |
-func (d *driver) startSerfLoop(eventCh chan serf.Event, notifyCh chan ovNotify, |
|
| 183 |
- exitCh chan chan struct{}) {
|
|
| 184 |
- |
|
| 182 |
+func (d *driver) startSerfLoop(eventCh chan serf.Event, notifyCh chan ovNotify, exitCh chan chan struct{}) {
|
|
| 185 | 183 |
for {
|
| 186 | 184 |
select {
|
| 187 | 185 |
case notify, ok := <-notifyCh: |
| ... | ... |
@@ -168,9 +168,7 @@ func (d *driver) peerDbSearch(nid string, peerIP net.IP) (*peerKey, *peerEntry, |
| 168 | 168 |
return pKeyMatched, pEntryMatched, nil |
| 169 | 169 |
} |
| 170 | 170 |
|
| 171 |
-func (d *driver) peerDbAdd(nid, eid string, peerIP net.IP, peerIPMask net.IPMask, |
|
| 172 |
- peerMac net.HardwareAddr, vtep net.IP, isLocal bool) (bool, int) {
|
|
| 173 |
- |
|
| 171 |
+func (d *driver) peerDbAdd(nid, eid string, peerIP net.IP, peerIPMask net.IPMask, peerMac net.HardwareAddr, vtep net.IP, isLocal bool) (bool, int) {
|
|
| 174 | 172 |
d.peerDb.Lock() |
| 175 | 173 |
pMap, ok := d.peerDb.mp[nid] |
| 176 | 174 |
if !ok {
|
| ... | ... |
@@ -205,9 +203,7 @@ func (d *driver) peerDbAdd(nid, eid string, peerIP net.IP, peerIPMask net.IPMask |
| 205 | 205 |
return b, i |
| 206 | 206 |
} |
| 207 | 207 |
|
| 208 |
-func (d *driver) peerDbDelete(nid, eid string, peerIP net.IP, peerIPMask net.IPMask, |
|
| 209 |
- peerMac net.HardwareAddr, vtep net.IP, isLocal bool) (bool, int) {
|
|
| 210 |
- |
|
| 208 |
+func (d *driver) peerDbDelete(nid, eid string, peerIP net.IP, peerIPMask net.IPMask, peerMac net.HardwareAddr, vtep net.IP, isLocal bool) (bool, int) {
|
|
| 211 | 209 |
d.peerDb.Lock() |
| 212 | 210 |
pMap, ok := d.peerDb.mp[nid] |
| 213 | 211 |
if !ok {
|
| ... | ... |
@@ -340,9 +336,7 @@ func (d *driver) peerAdd(nid, eid string, peerIP net.IP, peerIPMask net.IPMask, |
| 340 | 340 |
} |
| 341 | 341 |
} |
| 342 | 342 |
|
| 343 |
-func (d *driver) peerAddOp(nid, eid string, peerIP net.IP, peerIPMask net.IPMask, |
|
| 344 |
- peerMac net.HardwareAddr, vtep net.IP, l2Miss, l3Miss, updateDB, localPeer bool) error {
|
|
| 345 |
- |
|
| 343 |
+func (d *driver) peerAddOp(nid, eid string, peerIP net.IP, peerIPMask net.IPMask, peerMac net.HardwareAddr, vtep net.IP, l2Miss, l3Miss, updateDB, localPeer bool) error {
|
|
| 346 | 344 |
if err := validateID(nid, eid); err != nil {
|
| 347 | 345 |
return err |
| 348 | 346 |
} |
| ... | ... |
@@ -432,9 +426,7 @@ func (d *driver) peerDelete(nid, eid string, peerIP net.IP, peerIPMask net.IPMas |
| 432 | 432 |
} |
| 433 | 433 |
} |
| 434 | 434 |
|
| 435 |
-func (d *driver) peerDeleteOp(nid, eid string, peerIP net.IP, peerIPMask net.IPMask, |
|
| 436 |
- peerMac net.HardwareAddr, vtep net.IP, localPeer bool) error {
|
|
| 437 |
- |
|
| 435 |
+func (d *driver) peerDeleteOp(nid, eid string, peerIP net.IP, peerIPMask net.IPMask, peerMac net.HardwareAddr, vtep net.IP, localPeer bool) error {
|
|
| 438 | 436 |
if err := validateID(nid, eid); err != nil {
|
| 439 | 437 |
return err |
| 440 | 438 |
} |
| ... | ... |
@@ -178,7 +178,6 @@ func (ep *endpoint) UnmarshalJSON(b []byte) (err error) {
|
| 178 | 178 |
tplist = append(tplist, tp) |
| 179 | 179 |
} |
| 180 | 180 |
ep.generic[netlabel.ExposedPorts] = tplist |
| 181 |
- |
|
| 182 | 181 |
} |
| 183 | 182 |
} |
| 184 | 183 |
|
| ... | ... |
@@ -580,7 +579,6 @@ func (ep *endpoint) sbJoin(sb *sandbox, options ...EndpointOption) (err error) {
|
| 580 | 580 |
ep.Name(), ep.ID(), err) |
| 581 | 581 |
} |
| 582 | 582 |
} |
| 583 |
- |
|
| 584 | 583 |
} |
| 585 | 584 |
|
| 586 | 585 |
if !sb.needDefaultGW() {
|
| ... | ... |
@@ -7,7 +7,6 @@ import ( |
| 7 | 7 |
) |
| 8 | 8 |
|
| 9 | 9 |
func TestErrorInterfaces(t *testing.T) {
|
| 10 |
- |
|
| 11 | 10 |
badRequestErrorList := []error{ErrInvalidID(""), ErrInvalidName(""), ErrInvalidJoin{}, ErrInvalidNetworkDriver(""), InvalidContainerIDError(""), ErrNoSuchNetwork(""), ErrNoSuchEndpoint("")}
|
| 12 | 11 |
for _, err := range badRequestErrorList {
|
| 13 | 12 |
switch u := err.(type) {
|
| ... | ... |
@@ -47,5 +46,4 @@ func TestErrorInterfaces(t *testing.T) {
|
| 47 | 47 |
t.Fatalf("Failed to detect err %v is of type ForbiddenError. Got type: %T", err, u)
|
| 48 | 48 |
} |
| 49 | 49 |
} |
| 50 |
- |
|
| 51 | 50 |
} |
| ... | ... |
@@ -209,7 +209,6 @@ func TestUpdateIgnoresPrefixedHostname(t *testing.T) {
|
| 209 | 209 |
if expected := "5.5.5.5\tprefix\n3.3.3.3\tprefixAndMore\n4.4.4.4\tunaffectedHost\n"; !bytes.Contains(content, []byte(expected)) {
|
| 210 | 210 |
t.Fatalf("Expected to find '%s' got '%s'", expected, content)
|
| 211 | 211 |
} |
| 212 |
- |
|
| 213 | 212 |
} |
| 214 | 213 |
|
| 215 | 214 |
// This regression test covers the host prefix issue for the |
| ... | ... |
@@ -1056,7 +1056,6 @@ func TestOverlappingRequests(t *testing.T) {
|
| 1056 | 1056 |
} |
| 1057 | 1057 |
|
| 1058 | 1058 |
func TestUnusualSubnets(t *testing.T) {
|
| 1059 |
- |
|
| 1060 | 1059 |
subnet := "192.168.0.2/31" |
| 1061 | 1060 |
|
| 1062 | 1061 |
outsideTheRangeAddresses := []struct {
|
| ... | ... |
@@ -1075,7 +1074,6 @@ func TestUnusualSubnets(t *testing.T) {
|
| 1075 | 1075 |
} |
| 1076 | 1076 |
|
| 1077 | 1077 |
for _, store := range []bool{false, true} {
|
| 1078 |
- |
|
| 1079 | 1078 |
allocator, err := getAllocator(store) |
| 1080 | 1079 |
if err != nil {
|
| 1081 | 1080 |
t.Fatal(err) |
| ... | ... |
@@ -1117,7 +1115,6 @@ func TestUnusualSubnets(t *testing.T) {
|
| 1117 | 1117 |
if err != ipamapi.ErrNoAvailableIPs {
|
| 1118 | 1118 |
t.Fatal("Did not get expected error when pool is exhausted.")
|
| 1119 | 1119 |
} |
| 1120 |
- |
|
| 1121 | 1120 |
} |
| 1122 | 1121 |
} |
| 1123 | 1122 |
|
| ... | ... |
@@ -1264,7 +1261,6 @@ func benchmarkRequest(b *testing.B, a *Allocator, subnet string) {
|
| 1264 | 1264 |
} |
| 1265 | 1265 |
|
| 1266 | 1266 |
func BenchmarkRequest(b *testing.B) {
|
| 1267 |
- |
|
| 1268 | 1267 |
subnets := []string{
|
| 1269 | 1268 |
"10.0.0.0/24", |
| 1270 | 1269 |
"10.0.0.0/16", |
| ... | ... |
@@ -206,7 +206,7 @@ func getDockerZoneSettings() []interface{} {
|
| 206 | 206 |
description: "zone for docker bridge network interfaces", |
| 207 | 207 |
target: "ACCEPT", |
| 208 | 208 |
} |
| 209 |
- slice := []interface{}{
|
|
| 209 |
+ return []interface{}{
|
|
| 210 | 210 |
settings.version, |
| 211 | 211 |
settings.name, |
| 212 | 212 |
settings.description, |
| ... | ... |
@@ -224,8 +224,6 @@ func getDockerZoneSettings() []interface{} {
|
| 224 | 224 |
settings.sourcePorts, |
| 225 | 225 |
settings.icmpBlockInversion, |
| 226 | 226 |
} |
| 227 |
- return slice |
|
| 228 |
- |
|
| 229 | 227 |
} |
| 230 | 228 |
|
| 231 | 229 |
// setupDockerZone creates a zone called docker in firewalld which includes docker interfaces to allow |
| ... | ... |
@@ -260,7 +260,6 @@ func (iptable IPTable) ProgramChain(c *ChainInfo, bridgeName string, hairpinMode |
| 260 | 260 |
} else if len(output) != 0 {
|
| 261 | 261 |
return fmt.Errorf("Could not delete linking rule from %s/%s: %s", c.Table, c.Name, output)
|
| 262 | 262 |
} |
| 263 |
- |
|
| 264 | 263 |
} |
| 265 | 264 |
establish := []string{
|
| 266 | 265 |
"-o", bridgeName, |
| ... | ... |
@@ -301,7 +300,6 @@ func (iptable IPTable) RemoveExistingChain(name string, table Table) error {
|
| 301 | 301 |
|
| 302 | 302 |
// Forward adds forwarding rule to 'filter' table and corresponding nat rule to 'nat' table. |
| 303 | 303 |
func (c *ChainInfo) Forward(action Action, ip net.IP, port int, proto, destAddr string, destPort int, bridgeName string) error {
|
| 304 |
- |
|
| 305 | 304 |
iptable := GetIptable(c.IPTable.Version) |
| 306 | 305 |
daddr := ip.String() |
| 307 | 306 |
if ip.IsUnspecified() {
|
| ... | ... |
@@ -400,7 +400,6 @@ func TestNetworkConfig(t *testing.T) {
|
| 400 | 400 |
if err := configNetwork.Delete(); err != nil {
|
| 401 | 401 |
t.Fatal(err) |
| 402 | 402 |
} |
| 403 |
- |
|
| 404 | 403 |
} |
| 405 | 404 |
|
| 406 | 405 |
func TestUnknownNetwork(t *testing.T) {
|
| ... | ... |
@@ -1054,7 +1053,6 @@ func TestEndpointMultipleJoins(t *testing.T) {
|
| 1054 | 1054 |
if _, ok := err.(types.ForbiddenError); !ok {
|
| 1055 | 1055 |
t.Fatalf("Failed with unexpected error type: %T. Desc: %s", err, err.Error())
|
| 1056 | 1056 |
} |
| 1057 |
- |
|
| 1058 | 1057 |
} |
| 1059 | 1058 |
|
| 1060 | 1059 |
func TestLeaveAll(t *testing.T) {
|
| ... | ... |
@@ -1168,7 +1168,6 @@ func (n *network) CreateEndpoint(name string, options ...EndpointOption) (Endpoi |
| 1168 | 1168 |
defer n.ctrlr.networkLocker.Unlock(n.id) //nolint:errcheck |
| 1169 | 1169 |
|
| 1170 | 1170 |
return n.createEndpoint(name, options...) |
| 1171 |
- |
|
| 1172 | 1171 |
} |
| 1173 | 1172 |
|
| 1174 | 1173 |
func (n *network) createEndpoint(name string, options ...EndpointOption) (Endpoint, error) {
|
| ... | ... |
@@ -1953,7 +1952,6 @@ func (n *network) TableEventRegister(tableName string, objType driverapi.ObjectT |
| 1953 | 1953 |
} |
| 1954 | 1954 |
|
| 1955 | 1955 |
func (n *network) UpdateIpamConfig(ipV4Data []driverapi.IPAMData) {
|
| 1956 |
- |
|
| 1957 | 1956 |
ipamV4Config := make([]*IpamConf, len(ipV4Data)) |
| 1958 | 1957 |
|
| 1959 | 1958 |
for i, data := range ipV4Data {
|
| ... | ... |
@@ -2233,7 +2231,6 @@ func (n *network) deleteLoadBalancerSandbox() error {
|
| 2233 | 2233 |
if err != nil {
|
| 2234 | 2234 |
logrus.Warnf("Failed to find load balancer endpoint %s on network %s: %v", endpointName, name, err)
|
| 2235 | 2235 |
} else {
|
| 2236 |
- |
|
| 2237 | 2236 |
info := endpoint.Info() |
| 2238 | 2237 |
if info != nil {
|
| 2239 | 2238 |
sb := info.Sandbox() |
| ... | ... |
@@ -183,7 +183,6 @@ func (n *networkNamespace) AddStaticRoute(r *types.StaticRoute) error {
|
| 183 | 183 |
} |
| 184 | 184 |
|
| 185 | 185 |
func (n *networkNamespace) RemoveStaticRoute(r *types.StaticRoute) error {
|
| 186 |
- |
|
| 187 | 186 |
err := n.removeRoute(n.nsPath(), r.Destination, r.NextHop) |
| 188 | 187 |
if err == nil {
|
| 189 | 188 |
n.Lock() |
| ... | ... |
@@ -166,7 +166,6 @@ func TestDNSIPQuery(t *testing.T) {
|
| 166 | 166 |
t.Log("Response: ", resp.String())
|
| 167 | 167 |
checkDNSResponseCode(t, resp, dns.RcodeServerFailure) |
| 168 | 168 |
w.ClearResponse() |
| 169 |
- |
|
| 170 | 169 |
} |
| 171 | 170 |
|
| 172 | 171 |
func newDNSHandlerServFailOnce(requests *int) func(w dns.ResponseWriter, r *dns.Msg) {
|
| ... | ... |
@@ -569,7 +569,6 @@ func (sb *sandbox) ResolveName(name string, ipType int) ([]net.IP, bool) {
|
| 569 | 569 |
} |
| 570 | 570 |
|
| 571 | 571 |
for i := 0; i < len(reqName); i++ {
|
| 572 |
- |
|
| 573 | 572 |
// First check for local container alias |
| 574 | 573 |
ip, ipv6Miss := sb.resolveName(reqName[i], networkName[i], epList, true, ipType) |
| 575 | 574 |
if ip != nil {
|
| ... | ... |
@@ -209,9 +209,7 @@ func (sb *sandbox) setupDNS() error {
|
| 209 | 209 |
|
| 210 | 210 |
// When the user specify a conainter in the host namespace and do no have any dns option specified |
| 211 | 211 |
// we just copy the host resolv.conf from the host itself |
| 212 |
- if sb.config.useDefaultSandBox && |
|
| 213 |
- len(sb.config.dnsList) == 0 && len(sb.config.dnsSearchList) == 0 && len(sb.config.dnsOptionsList) == 0 {
|
|
| 214 |
- |
|
| 212 |
+ if sb.config.useDefaultSandBox && len(sb.config.dnsList) == 0 && len(sb.config.dnsSearchList) == 0 && len(sb.config.dnsOptionsList) == 0 {
|
|
| 215 | 213 |
// We are working under the assumption that the origin file option had been properly expressed by the upper layer |
| 216 | 214 |
// if not here we are going to error out |
| 217 | 215 |
if err := copyFile(sb.config.originResolvConfPath, sb.config.resolvConfPath); err != nil {
|
| ... | ... |
@@ -325,7 +323,7 @@ func (sb *sandbox) updateDNS(ipv6Enabled bool) error {
|
| 325 | 325 |
if currHash != "" && currHash != currRC.Hash {
|
| 326 | 326 |
// Seems the user has changed the container resolv.conf since the last time |
| 327 | 327 |
// we checked so return without doing anything. |
| 328 |
- //logrus.Infof("Skipping update of resolv.conf file with ipv6Enabled: %t because file was touched by user", ipv6Enabled)
|
|
| 328 |
+ // logrus.Infof("Skipping update of resolv.conf file with ipv6Enabled: %t because file was touched by user", ipv6Enabled)
|
|
| 329 | 329 |
return nil |
| 330 | 330 |
} |
| 331 | 331 |
|
| ... | ... |
@@ -213,7 +213,6 @@ func (c *controller) cleanupServiceBindings(cleanupNID string) {
|
| 213 | 213 |
for _, f := range cleanupFuncs {
|
| 214 | 214 |
f() |
| 215 | 215 |
} |
| 216 |
- |
|
| 217 | 216 |
} |
| 218 | 217 |
|
| 219 | 218 |
func makeServiceCleanupFunc(c *controller, s *service, nID, eID string, vip net.IP, ip net.IP) func() {
|
| ... | ... |
@@ -315,7 +314,6 @@ func (c *controller) addServiceBinding(svcName, svcID, nID, eID, containerName s |
| 315 | 315 |
} |
| 316 | 316 |
|
| 317 | 317 |
func (c *controller) rmServiceBinding(svcName, svcID, nID, eID, containerName string, vip net.IP, ingressPorts []*PortConfig, serviceAliases []string, taskAliases []string, ip net.IP, method string, deleteSvcRecords bool, fullRemove bool) error {
|
| 318 |
- |
|
| 319 | 318 |
var rmService bool |
| 320 | 319 |
|
| 321 | 320 |
skey := serviceKey{
|
| ... | ... |
@@ -319,7 +319,6 @@ func (c *controller) networkWatchLoop(nw *netWatch, ep *endpoint, ecCh <-chan da |
| 319 | 319 |
|
| 320 | 320 |
for _, lEp := range delEpMap {
|
| 321 | 321 |
ep.getNetwork().updateSvcRecord(lEp, c.getLocalEps(nw), false) |
| 322 |
- |
|
| 323 | 322 |
} |
| 324 | 323 |
for _, lEp := range addEp {
|
| 325 | 324 |
ep.getNetwork().updateSvcRecord(lEp, c.getLocalEps(nw), true) |