The uint128 type is very convenient for manipulating 128 bit-wide
quantities, as tends to come up in several contexts when working with
IPv6. Move it into a libnetwork/internal/ package so it can be reused
elsewhere within libnetwork.
Signed-off-by: Cory Snider <csnider@mirantis.com>
Don't include the deprecated `id`, `status`, and `from` fields
in the response; they're no longer part of the API since v1.22
([moby@72f188]).
[moby@72f188]: 72f1881df1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
`vm` is quite lengthy which makes it impossible to restart other failed
(flaky) jobs from the `test` workflow before the `vm` finishes.
This patch moves it to a separate workflow to allow retrying other jobs
independently.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
`tar` utility is included in Windows 10 (17063+) and Windows Server
2019+ so we can use it directly.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Sets up the labeler workflow to automatically label PRs affecting the
`client` and `api` modules.
This allows to distinguish PRs targetting different modules.
TODO: Figure out how to handle PRs that would end up with both labels.
However, I think it's good to see what PRs would that affect.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This function was providing a way to set all API options directly,
however the api type was moved to client in 853aed1 so this option no
longer makes sense as it's exposing a part of the private struct at this
point.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The only viable way to allocate a port is to bind and listen to it. So,
the windows PortMapper was really a PortAllocator in disguise.
Rename it to OSAllocator and move it to the portallocator package.
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This package was originally internal, but was moved out when BuildKit
used it for its integration tests. That's no longer the case, so we
can make it internal again.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The windows port mapper is needlessly complex while its job is pretty
straightforward: reserve a port through the port allocator, and start a
dummy proxy to allocate it from the OS.
The biggest source of complexity is the use of the `net.Addr` interface
to pass the host IP, port and proto. `MapRange` now has a proto arg, and
returns the allocated port.
`MapRange` is also instantiating a `mapping` struct whose fields are
all unused, except for its `stopUserlandProxy`. Instead, store
`stopProxy` callbacks directly into the `PortMapper`.
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This function is only called by New, and it takes the singleton
PortAllocator exposed by the portallocator package.
Remove this function and instantiate the PortMapper directly from New
constructor.
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
The portmapper struct provided by libnet/portmapper is only available
on Windows. Merge both files to reflect that.
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Prior to commit 4f09af626, DeleteForwardingTableEntry had a Linux
implementation. That's not the case anymore, and it's a no-op on
Windows. Remove it.
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Prior to commit 4f09af626, AppendForwardingTableEntry had a Linux
implementation. That's not the case anymore, and it's a no-op on
Windows. Remove it.
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Use the errdefs utilities to make sure we correctly detect the type
of error if a containerd errdefs type is returned.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
These were deprecated in f1bb44aeee, and
the IsContext is no longer used. They are not carried forward in the
new module.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
If neither of the DOCKER_INTEGRATION_DAEMON_DEST or DEST environment
variables are set, integration tests panic with a nil-dereference panic
in os.(*File).Name(...). This is a very unhelpful behaviour for someone
trying to run integration tests interactively. Fix up the logic to avoid
dereferencing nil os.File pointers and instead fail the test immediately
with an actionable error message.
Signed-off-by: Cory Snider <csnider@mirantis.com>
An inverted condition resulted in integration tests disabling the
userland proxy if the DOCKER_USERLANDPROXY environment variable is set
to a value that strconv.ParseBool cannot parse, leading to the confusing
behaviour of DOCKER_USERLANDPROXY=0 enabling the userland proxy and
DOCKER_USERLANDPROXY=foo disabling it. Fix up the logic so that
DOCKER_USERLANDPROXY=0 disables the userland proxy and
DOCKER_USERLANDPROXY=foo is an error.
Signed-off-by: Cory Snider <csnider@mirantis.com>