Commit graph

52 commits

Author SHA1 Message Date
Albin Kerouanton
bd0111c1f4
libnet: Replace NoServiceError with UnavailableError
UnavailableError is now compatible with errdefs.UnavailableError. These
errors will now return a 503 instead of a 500.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-08-17 16:46:53 +02:00
Albin Kerouanton
42d34e40f9
libnet: Replace BadRequest with InvalidParameter
InvalidParameter is now compatible with errdefs.InvalidParameter. Thus,
these errors will now return a 400 status code instead of a 500.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-08-17 16:45:04 +02:00
Sebastiaan van Stijn
7c2665298a
libnetwork/types: move GetMinimalIP to overlay-driver and un-export
It was only used in drivers/overlay, and was not a function for any
"type" defined by libnetwork.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-31 21:00:32 +02:00
Sebastiaan van Stijn
d9b7a5f01a
libnetwork/types: remove ErrInvalidProtocolBinding
It was not used as a sentinel error, and didn't carry a specific type,
which made it a rather complex way to create an error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-31 21:00:32 +02:00
Sebastiaan van Stijn
4445169cb5
libnetwork/types: remove PortBinding.Equal
It was only used in tests, so move it to a utility in the tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-31 21:00:26 +02:00
Sebastiaan van Stijn
4269712d06
libnetwork/types: remove unused UUID type
This type was added moved to the types package as part of a refactor
in 778e2a72b3
but the introduction of the sandbox API changed the existing API to
weak types (not using a plain string);
9a47be244a

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-31 20:57:48 +02:00
Sebastiaan van Stijn
c203171ef6
libnetwork/types: remove unused RetryError and TimeoutError
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-31 20:57:45 +02:00
Sebastiaan van Stijn
dd5ea7e996
libnetwork: format code with gofumpt
Formatting the code with https://github.com/mvdan/gofumpt

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-29 00:31:49 +02:00
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
Sebastiaan van Stijn
073f8df0fe
libnetwork/types: remove TransportPort.FromString() as it's unused
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-27 14:16:32 +02:00
Sebastiaan van Stijn
7c0d8fa5da
libnetwork/types: remove PortBinding.FromString() as it's unused
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-27 14:16:30 +02:00
Sebastiaan van Stijn
513310f776
libnetwork/types: remove GetMinimalIPNet() as it's unused
This wass addded in 4e48ff3aab
but never used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-27 14:16:28 +02:00
Sebastiaan van Stijn
c9ba301a49
libnetwork: move resolvconf consts into the resolvconf package
This allows using the package without having to import the "types" package,
and without having to consume github.com/ishidawataru/sctp.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 00:23:43 +02:00
Sebastiaan van Stijn
427ad30c05
libnetwork: remove unused "testutils" imports
Perhaps the testutils package in the past had an `init()` function to set up
specific things, but it no longer has. so these imports were doing nothing.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-18 14:20:37 +02: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
Tibor Vass
20c88eb92f Merge pull request #2583 from thaJeztah/update_docker_alt
vendor: update docker to 7ca355652f and reduce dependency graph
2020-09-17 13:29:33 -07:00
Sebastiaan van Stijn
3e1e9e878c vendor: gotest.tools v3.0.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:18 +02:00
Sebastiaan van Stijn
42b87e6a4b types: remove some dead code
These errors were not in use, so we can remove them

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-04 12:07:03 +02:00
Sascha Grunert
c5c8653912 Update sctp package
This commit updates the vendored ishidawataru/sctp and adapts its used
types.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-24 17:26:33 +02:00
Vincent Demeester
06d471d186 Migrate to gotest.tools :)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-07-06 11:01:37 -07:00
Euan Harris
6fd25eea33 ipam, types: Expand documentation
Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-07-04 09:50:31 +01:00
Flavio Crisciani
7fc1795cdf Allows to set generic knobs on the Sandbox
Refactor the ostweaks file to allows a more easy reuse
Add a method on the osl.Sandbox interface to allow setting
knobs on the sandbox

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-06-28 16:14:08 -07:00
Euan Harris
e3c212c224 types: Handle IPv6 literals correctly in port bindings
Use net.splitHostPort() instead of our own logic in func (p *PortBinding)
FromString(s string) error.   This means that IPv6 literals, including
IPv4 in IPv6 literals, can now be parsed from the string form of
PortBindings.   Zoned addresses do not work - net.splitHostPort() parses
them but net.ParseIP() cannot and returns an error.   This is ok because
we do not have a slot to store the zone name in PortBinding anyway.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-05-30 16:12:19 +01:00
Euan Harris
35f505210b types/types: Correct docstring typo for (PortBinding)FromString
Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-05-24 14:35:36 +01:00
Euan Harris
f6ddf88cec types/types_test: Rename test to match function
The function tested by TestUtilGetHostPortionIP is called GetHostPartIP.
Rename the test to match the function being tested.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-05-24 10:03:25 +01:00
Wataru Ishida
2120ed2363 Support SCTP port mapping
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-02-13 16:01:03 +09:00
Aaron Lehmann
cc0b7e6aad all: Avoid trivial uses of Sprintf
Use the string concatenation operator instead of using Sprintf for
simple string concatenation. This is usually easier to read, and allows
the compiler to detect problems with the type or number of operands,
which would be runtime errors with Sprintf.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-05-09 16:07:09 -07:00
Jana Radhakrishnan
8a225de00d Merge pull request #1205 from allencloud/fix-typos
use grep to find a/an misuse
2016-08-01 09:49:31 -07:00
Santhosh Manohar
b2b87577d4 Add support for encrypting gossip traffic
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-06-04 03:55:14 -07:00
allencloud
9f415d0cdb use grep to find a/an misuse
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-06-03 16:35:33 +08:00
allencloud
de588f950d fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-05-30 18:20:52 +08:00
Alessandro Boch
c891a47cb3 Merge pull request #1095 from mrjana/ipam
Remove all netlink/osl deps from ipam/ipamutils
2016-04-15 11:46:47 -07:00
Jana Radhakrishnan
b0d046a1af Remove all netlink/osl deps from ipam/ipamutils
Currently ipam/ipamutils has a bunch of dependencies
in osl and netlink which makes the ipam/ipamutils harder
to use independently with other applications. This PR
modularizes ipam/ipamutils into a standalone package
with no OS level dependencies.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-10 11:05:39 -07: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
allencloud
67596cc84c Fix some typos.
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-02-29 19:20:50 +08:00
Tim Düsterhus
7ff429e32d Use documentation IPv6 addresses (RFC 3849) in tests
Signed-off-by: Tim Düsterhus <tim@bastelstu.be>
2015-11-15 18:28:53 +01:00
Alessandro Boch
02386e85d5 Enable Network labels in backend
- Allow labels to be passed to network driver during network create

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-09 01:06:15 -07:00
Jana Radhakrishnan
c74538c22e Merge pull request #565 from mavenugo/adb
Moved InterfaceStatistics from osl into types package
2015-10-06 16:10:37 -07:00
Alessandro Boch
ddcfab5f81 libnetwork <-> ipam driver interaction
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-03 16:18:19 -07:00
Alessandro Boch
2aaef377f3 IPAM driver
- Add IPAM cotract and remote IPAM hooks
 - Add ipam registration in controller
 - Have default IPAM follow ipamapi contract

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-03 16:18:19 -07:00
Madhu Venugopal
caab594ffb Moved InterfaceStatistics from osl into types package
Exposing osl package outside libnetwork is not neccessary and the
InterfaceStatistics anyways belong to the types package.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-26 10:12:20 -07:00
Jana Radhakrishnan
a5bd12b963 Remove multiple interface in an endpoint
Currently the endpoint data model consists of multiple
interfaces per-endpoint. This seems to be an overkill
since there is no real use case for it. Removing it
to remove unnecessary complexity from the code.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-11 09:19:01 -07:00
Alessandro Boch
b2ff78548a Fix preferred ip allocation in ipam
- also provided a new utility to compute the
  host part ip address which is resilient to
  input passed in different representations.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Don Kjer
8d73de9722 Adding libnetwork support to publish on custom host port ranges.
See https://github.com/docker/docker/pull/12927 for docker portion.

Signed-off-by: Don Kjer <don.kjer@gmail.com>
2015-08-08 00:23:03 +00:00
Alessandro Boch
88c2c05ce9 Misc fixes to ip allocation in bridge driver
Two changes were missing:
- On allocation of bridge ip was not passing canonical subnet
- Canonical subnet has to be passed on ip release
  as well, otherwise ipallocator will attempt
  ip release from a non registered nw

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-07-24 16:59:27 -07:00
Madhu Venugopal
4c4f71e2ac Added a new RetryError to indicate the caller to possibly retry
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-17 16:46:08 -07:00
Jana Radhakrishnan
6d6aeff780 Make GenerateIfaceName generic
Currently GenerateIfaceName is defined in bridge.go
and it specifically tries to only generate an interface
name only with `veth` prefix. Make it generic so that it
can accept a prefix and length of random bytes. Also
move it to netutils since it is useful to generate various
kinds of interface names using it.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-08 09:49:17 -07:00
Zhang Wei
a4de736345 fix typo
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-05-29 16:31:12 +08:00
Tom Denham
65acaaf0b5 Allow drivers to supply static routes for interfaces
Signed-off-by: Tom Denham <tom.denham@metaswitch.com>
2015-05-25 19:25:30 -07:00
Alessandro Boch
c70cfcb150 Provide interface to categorize errors
- Package types to define the interfaces libnetwork errors
  may implement, so that caller can categorize them.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-20 22:29:29 -07:00