Commit graph

65 commits

Author SHA1 Message Date
Sebastiaan van Stijn
145817a9cf
libnetwork: use strconv instead of fmt.Sprintf()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-08 17:41:39 +02:00
Ameya Gawde
cba8cf34d2
Set ExternalPortReserved for dummy proxy
Signed-off-by: Ameya Gawde <agawde@mirantis.com>
2022-05-25 07:12:43 -07:00
Eng Zer Jun
7873c27cfb
all: replace strings.Replace with strings.ReplaceAll
strings.ReplaceAll(s, old, new) is a wrapper function for
strings.Replace(s, old, new, -1). But strings.ReplaceAll is more
readable and removes the hardcoded -1.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-05-09 19:45:40 +08:00
Sebastiaan van Stijn
1b3fef5333
Windows: require Windows Server RS5 / ltsc2019 (build 17763) as minimum
Windows Server 2016 (RS1) reached end of support, and Docker Desktop requires
Windows 10 V19H2 (version 1909, build 18363) as a minimum.

This patch makes Windows Server RS5 /  ltsc2019 (build 17763) the minimum version
to run the daemon, and removes some hacks for older versions of Windows.

There is one check remaining that checks for Windows RS3 for a workaround
on older versions, but recent changes in Windows seemed to have regressed
on the same issue, so I kept that code for now to check if we may need that
workaround (again);

085c6a98d5/daemon/graphdriver/windows/windows.go (L319-L341)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-02-18 22:58:28 +01:00
Sebastiaan van Stijn
686be57d0a
Update to Go 1.17.0, and gofmt with Go 1.17
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-24 23:33:27 +02:00
Brian Goff
20fd1dd7d2 Skip some windows network driver tests
These are failing in CI because something is not enabled.
Its not clear that these tests ever worked because they were not
actually running while in the libnetwork repo, which was only testing
Linux.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-01 22:15:10 +00:00
Brian Goff
a0a473125b Fix libnetwork imports
After moving libnetwork to this repo, we need to update all the import
paths for libnetwork to point to docker/docker/libnetwork instead of
docker/libnetwork.
This change implements that.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-01 21:51:23 +00:00
Sebastiaan van Stijn
bf28003c99 Replace use of deprecated functions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 01:49:42 +02:00
Pradip Dhara
f366d37c72 Updating IPAM config with results from HNS create network call.
In windows HNS manages IPAM.  If the user does not specify a subnet, HNS will choose one
for them.  However, in order for the IPAM to show up in the output of "docker inspect",
we need to update the network IPAMv4Config field.

Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2019-08-23 09:58:29 -07:00
Euan Harris
46bed879da Merge pull request #2231 from msabansal/winnetwork
Add support for Internal and Private network types on windows
2019-06-27 11:23:32 +01:00
Euan Harris
84414583f0 gofmt: Fix formatting warnings
Signed-off-by: Euan Harris <euan.harris@docker.com>
2019-06-26 16:54:31 +01:00
Pradip Dhara
a04a30717e Forcing a nil IP specified in PortBindings to IPv4zero (0.0.0.0).
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2019-05-13 15:42:32 -07:00
Pradip Dhara
1909ecb27a Pick a random host port if the user does not specify a host port.
For overlay, l2bridge, and l2tunnel, if the user does not specify a host port, windows driver will select a random port for them.  This matches linux behavior.
For ics and nat networks the windows OS will choose the port.

Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2019-04-22 17:43:27 +00:00
Madhu Venugopal
5c6423fb29 Adding error log if peerAdd fails
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2019-04-05 20:31:17 -07:00
Pradip Dhara
94ab7b2df6 Adding synchronization to endpoint addition/deletion to prevent network connectivity issue
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2019-04-05 14:19:19 -07:00
John Stephens
4fd54c2aea Do not fail with an empty transparent IPv4 address
When dockerd.exe is not stopped cleanly (such as when Windows is
restarted), the endpoints are not cleaned up. When using a transparent
network, the endpoint IPv4 address is blank. When dockerd.exe starts up
again, libnetwork restores the endpoint, which would not have been
stored on a clean shutdown of dockerd.exe. That fails because the IPv4
address is blank. This change warns instead of failing.

Signed-off-by: John Stephens <johnstep@docker.com>
2018-09-27 12:30:37 -07:00
Sandeep Bansal
012fcea177 Add support for Internal and Private network types on windows
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2018-07-12 13:58:10 -07:00
Chris Telfer
06922d2d81 Use fmt precision to limit string length
The previous code used string slices to limit the length of certain
fields like endpoint or sandbox IDs.  This assumes that these strings
are at least as long as the slice length.  Unfortunately, some sandbox
IDs can be smaller than 7 characters.   This fix addresses this issue
by systematically converting format string calls that were taking
fixed-slice arguments to use a precision specifier in the string format
itself.  From the golang fmt package documentation:

    For strings, byte slices and byte arrays, however, precision limits
    the length of the input to be formatted (not the size of the output),
    truncating if necessary. Normally it is measured in runes, but for
    these types when formatted with the %x or %X format it is measured
    in bytes.

This nicely fits the desired behavior: it will limit the number of
runes considered for string interpolation to the precision value.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-07-05 17:44:04 -04:00
Euan Harris
96c7cba64c networkdb, drivers: Regenerate protocol buffers
agent.pb.go is unchanged, but the files in networkdb and drivers
are slightly different when regenerated using the current versions
of protoc and gogoproto.    This is probably because agent.pb.go
was last regenerated quite recently, in February 2018, whereas
networkdb.pb.go and overlay/overlay.pb.go were last changed in 2017,
and windows/overlay/overlay.pb.go was last changed in 2016.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-06-22 15:03:12 +01:00
John Stephens
c8a3950d8b Delete stale HNS endpoints when creating a network
Signed-off-by: John Stephens <johnstep@docker.com>
2018-03-05 00:12:00 -08:00
Nick Wood
bbbfa21a94 libnetwork Windows driver support for outboundnat policy via generic options
Signed-off-by: Nick Wood <nwood@microsoft.com>
2018-02-05 17:07:26 -08:00
Cheng-mean Liu
5a5b7fee33 Added a new network creation driver option (disable_gatewaydns) for the Windows driver
Signed-off-by: Cheng-mean Liu <soccerl@microsoft.com>
2017-11-21 11:35:32 -08:00
Madhu Venugopal
1d1f63d4fb Merge pull request #1951 from msabansal/savefail
Ignore failure to save hns endpoint to store
2017-10-24 10:56:27 -07:00
Pradip Dhara
955b8b4593 Changing containerID to sandboxID based off feedback/conversation with Madhu.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-10-02 22:48:06 -07:00
Madhan Raj Mookkandy
b0888450a9 Enable Hot Add/Remove of Network Endpoints for Windows
Signed-off-by: Madhan Raj Mookkandy <madhanm@microsoft.com>
2017-10-02 22:19:18 -07:00
Sandeep Bansal
8b400916ce Ignore failure to save hns endpoint to store
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-09-21 23:24:55 -07:00
Pradip Dhara
0651183f84 gofmt and lint changes.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-08-09 15:53:27 -07:00
Pradip Dhara
404a9ffa5a For RS3, tasks connected to a swarm network will have 1 endpoint .
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-08-09 14:13:59 -07:00
Derek McGowan
710e0664c4 Update logrus to v1.0.1
Fix case sensitivity issue
Update docker and runc vendors

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-08-07 11:20:47 -07:00
Madhu Venugopal
d01e1d38c3 Merge pull request #1755 from msabansal/msabansal/ics
Changes to support ICS network on windows
2017-07-07 18:28:13 +05:30
Sandeep Bansal
2d278dece0 Fixes docker daemon not restarting after endpoint leak on windows with transaprent network
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-06-15 13:27:48 -07:00
Flavio Crisciani
65860255c6 Fixed code issues
Fixed issues highlighted by the new checks

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-12 11:31:35 -07:00
Sandeep Bansal
6d7e9ea6b4 Changes to support ICS network on windows
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-05-18 13:45:38 -07:00
Sandeep Bansal
f566d6384e Added persistence to windows driver so that cleanup happens properly
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-05-16 14:06:43 -07:00
Alessandro Boch
254d082cc3 Add ConnectivityScope capability for network drivers along with scope network option
- It specifies whether the network driver can
  provide containers connectivity across hosts.
- As of now, the data scope of the driver was
  being overloaded with this notion.
- The driver scope information is still valid
  and it defines whether the data allocation
  of the network resources can be done globally
  or only locally.
- With the scope network option, user can now
  force a network as swarm scoped
  regardless of the driver data scope.
- In case the network is configured as swarm scoped,
  and the network driver is multihost capable,
  a network DB instance will be launched for it.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-05-12 17:16:34 -07:00
Santhosh Manohar
bfab379411 swarm mode network inspect should provide cluser-wide task details
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-03-10 19:12:00 -08:00
msabansal
66895dfdfc Clearing up windows overlay driver to just work in swarm mode
Signed-off-by: msabansal <sabansal@microsoft.com>
2017-02-08 11:49:44 -08:00
allencloud
bc85efdb4f fix nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-12-28 18:49:18 +08:00
Madhu Venugopal
1b28c5e01d Internal interface to differentiate built-in drivers from remote
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-12-19 05:17:42 -08:00
Madhu Venugopal
1b8698e148 Merge pull request #1541 from msabansal/defaultgw
Default GW support for overlay networks
2016-11-08 14:34:26 -08:00
msabansal
261fedba8c Default GW support for overlay networks
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-11-08 14:12:29 -08:00
Daehyeok Mun
7f473c779a Refactoring logrus import and formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.
Also fix import name to use original project name 'logrus' instead of
'log'

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2016-11-08 12:42:41 -07:00
Madhu Venugopal
d1b012d97a Windows overlay driver support
1. Base work was done by msabansal and nwoodmsft
   from : https://github.com/msabansal/docker/tree/overlay
2. reorganized under drivers/windows/overlay and rebased to
   libnetwork master
3. Porting overlay common fixes to windows driver
    * 46f525c
    * ba8714e
    * 6368406
4. Windows Service Discovery changes for swarm-mode
5. renaming default windows ipam drivers as "windows"

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Signed-off-by: msabansal <sabansal@microsoft.com>
Signed-off-by: nwoodmsft <Nicholas.Wood@microsoft.com>
2016-11-03 16:50:04 -07:00
msabansal
7f43fd30f3 DNS support
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-09-20 13:02:02 -07:00
msabansal
43a2b083e8 Static ip support for windows
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-04-20 15:44:32 -07:00
Jana Radhakrishnan
6fb69f0816 Add driver api enhancements for gossip
With the introduction of a driver generic gossip in libnetwork it is not
necessary for drivers to run their own gossip protocol (like what
overlay driver is doing currently) but instead rely on the gossip
instance run centrally in libnetwork. In order to achieve this, certain
enhancements to driver api are needed. This api aims to provide these
enhancements.

The new api provides a way for drivers to register interest on table
names of their choice by returning a list of table names of interest as
a response to CreateNetwork. By doing that they will get notified if a
CRUD operation happened on the tables of their interest, via the newly
added EventNotify call.

Drivers themselves can add entries to any table during a Join call by
invoking AddTableEntry method any number of times during the Join
call. These entries lifetime is the same as the endpoint itself. As soon
as the container leaves the endpoint, those entries added by driver
during that endpoint's Join call will be automatically removed by
libnetwork. This action may trigger notification of such deletion to all
driver instances in the cluster who have registered interest in that
table's notification.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-18 19:55:39 -07:00
Jana Radhakrishnan
c0162f53a6 Add overlay manager driver
Because overlay is a builtin driver and global allocation of overlay
resources is probably going to happen in a different node (a single
node) and the actual plumbing of the network is probably going to happen
in all nodes, it makes sense to split the functionality of allocation
into two different packages. The central component(this package) only
implements the NetworkAllocate/Free apis while the distributed
component(the existing overlay driver) implements the rest of the driver
api. This way we can reduce the memory footprint overall.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-14 10:37:42 -07:00
Chun Chen
83d8a3527a Fix broken CI because of newly introduced NetworkAllocate/NetworkFree api
Signed-off-by: Chun Chen <ramichen@tencent.com>
2016-04-13 16:04:58 +08:00
Darren Stahl
5b3524af9f Added maximum egress bandwidth qos for Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-03-28 14:50:55 -07:00
msabansal
7089723ee2 Fixing support for static mac and updating dependencies
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-03-16 11:07:20 -07:00