| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
That method was only referenced by ipam.Allocator, but as it no longer
stores any state persistently there is no possibility for it to load an
inconsistent bit-sequence from Docker 1.9.x.
Signed-off-by: Cory Snider <csnider@mirantis.com>
|
| |
|
|
| |
Signed-off-by: Cory Snider <csnider@mirantis.com>
|
| |
|
|
|
|
|
|
| |
*bitseq.Handle should not implement sync.Locker. The mutex is a private
implementation detail which external consumers should not be able to
manipulate.
Signed-off-by: Cory Snider <csnider@mirantis.com>
|
| |
|
|
| |
Signed-off-by: Cory Snider <csnider@mirantis.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
Older versions of Go don't format comments, so committing this as
a separate commit, so that we can already make these changes before
we upgrade to Go 1.19.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
|
| |
|
|
| |
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Yan Zhu <yanzhu@alauda.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* addresses
* assigned
* at least
* attachments
* auxiliary
* available
* cleanup
* communicate
* communications
* configuration
* connection
* connectivity
* destination
* encountered
* endpoint
* example
* existing
* expansion
* expected
* external
* forwarded
* gateway
* implementations
* implemented
* initialize
* internally
* loses
* message
* network
* occurred
* operational
* origin
* overlapping
* reaper
* redirector
* release
* representation
* resolver
* retrieve
* returns
* sanbdox
* sequence
* succesful
* synchronizing
* update
* validates
Signed-off-by: Josh Soref <jsoref@gmail.com>
|
| |
|
|
| |
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit contains fixes for duplicate IP with 3 issues addressed:
1) Race condition when datastore is not present in cases like swarmkit
2) Byte Offset calculation depending on where the start of the bit
in the bitsequence is, the offset was adding more bytes to the offset
when the start of the bit is in the middle of one of the instances in
a block
3) Finding the available bit was returning the last bit in the curent instance in
a block if the block is not full and the current bit is after the last
available bit.
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
|
| |
|
|
| |
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
|
| |
|
|
|
|
|
|
|
|
| |
Previously the bitseq alloc was allocating the first available bit from the
begining of the sequence. With this commit the bitseq alloc will proceed
from the current allocation. This change will affect the way ipam and vni
allocation is done currently. The ip allocation will be done sequentially
from the previous allocation as opposed to the first available IP.
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
|
| |
|
|
|
|
|
| |
Fix case sensitivity issue
Update docker and runc vendors
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
|
| |
|
|
|
|
|
|
|
|
|
| |
The byteoffset calculation was skewed to double include
the offset value calculated. The double calculation
happens if the starting ordinal is part of the head
sequence block. This error in calculation could result
in duplicate but getting allocated eventually propogating
to ipam and vni id allocations
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
|
| |\
| |
| | |
Remove unnecessary string formats
|
| | |
| |
| |
| | |
Signed-off-by: Ke Li <kel@splunk.com>
|
| |/
|
|
| |
Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
- size 1 range is a valid input
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
| |
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
|
| |
|
|
|
|
| |
All of them were found and fixed by codespell.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
|
| |
|
|
| |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove from contract predefined errors which are no longer
valid (ex. ErrInvalidIpamService, ErrInvalidIpamConfigService)
- Do not use network driver error for ipam load failure in controller.go
- Bitseq to expose two well-known errors (no more bit available, bit is already set)
- Default ipam to report proper well-known error on RequestAddress()
based on bitseq returned error
- Default ipam errors to comply with types error interface
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Race detector message:
WARNING: DATA RACE
Write by goroutine 269:
github.com/docker/libnetwork/bitseq.(*Handle).CopyTo()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/bitseq/store.go:85 +0x2f6
github.com/docker/libnetwork/datastore.(*cache).get()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/datastore/cache.go:135 +0x307
github.com/docker/libnetwork/datastore.(*datastore).GetObject()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/datastore/datastore.go:438 +0x121
github.com/docker/libnetwork/bitseq.(*Handle).set()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/bitseq/sequence.go:254 +0x1a5
github.com/docker/libnetwork/bitseq.(*Handle).Unset()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/bitseq/sequence.go:227 +0xb0
github.com/docker/libnetwork/ipam.(*Allocator).ReleaseAddress()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/ipam/allocator.go:446 +0x10bc
github.com/docker/libnetwork.(*endpoint).releaseAddress()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/endpoint.go:830 +0x731
github.com/docker/libnetwork.(*endpoint).Delete()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/endpoint.go:624 +0x8d8
github.com/docker/libnetwork.(*sandbox).Delete()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandbox.go:191 +0x1047
github.com/docker/docker/daemon.(*Daemon).releaseNetwork()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/container_unix.go:1180 +0x676
github.com/docker/docker/daemon.(*Daemon).Cleanup()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/start.go:157 +0x5d
github.com/docker/docker/daemon.(*containerMonitor).Close()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:111 +0xa4
github.com/docker/docker/daemon.(*containerMonitor).Start.func1()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:142 +0x14b
github.com/docker/docker/daemon.(*containerMonitor).Start()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:223 +0x1159
github.com/docker/docker/daemon.(*containerMonitor).Start-fm()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/start.go:147 +0x3b
github.com/docker/docker/pkg/promise.Go.func1()
/home/moroz/project/workspace/src/github.com/docker/docker/pkg/promise/promise.go:8 +0x2a
Previous read by goroutine 340:
github.com/docker/libnetwork/bitseq.(*Handle).set()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/bitseq/sequence.go:254 +0x133
github.com/docker/libnetwork/bitseq.(*Handle).Unset()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/bitseq/sequence.go:227 +0xb0
github.com/docker/libnetwork/ipam.(*Allocator).ReleaseAddress()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/ipam/allocator.go:446 +0x10bc
github.com/docker/libnetwork.(*endpoint).releaseAddress()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/endpoint.go:830 +0x731
github.com/docker/libnetwork.(*endpoint).Delete()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/endpoint.go:624 +0x8d8
github.com/docker/libnetwork.(*sandbox).Delete()
/home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandbox.go:191 +0x1047
github.com/docker/docker/daemon.(*Daemon).releaseNetwork()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/container_unix.go:1180 +0x676
github.com/docker/docker/daemon.(*Daemon).Cleanup()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/start.go:157 +0x5d
github.com/docker/docker/daemon.(*containerMonitor).Close()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:111 +0xa4
github.com/docker/docker/daemon.(*containerMonitor).Start.func1()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:142 +0x14b
github.com/docker/docker/daemon.(*containerMonitor).Start()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:223 +0x1159
github.com/docker/docker/daemon.(*containerMonitor).Start-fm()
/home/moroz/project/workspace/src/github.com/docker/docker/daemon/start.go:147 +0x3b
github.com/docker/docker/pkg/promise.Go.func1()
/home/moroz/project/workspace/src/github.com/docker/docker/pkg/promise/promise.go:8 +0x2a
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- pushReservation fails to correctly detect when
the affected block is the last in the current
sequence. It thinks instead the block is in between
the sequence. Because of this a couple of issues
may happen:
1. The allocation of the last bit causes the creation
of a phantom sequence (length 0) at the end.
(This has no side effects).
2. The allocation of a bit somewhere in the middle of
the bitmask may lead to a completely incorrect
sequence pattern.
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
|
| |
- Allow bitsequence of length 2^64-1
- Updated ID Manager and IPAM
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
|
|
| |
- Set bridge ipv4 address when bridge is present
- IPv6 changes for bridge
- Convert unit tests to the new model
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
|
|
|
| |
Remove the need for watching for IPAM data
structures and add multi store support code and
data reorganization to simplify address space
management.
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
|
| |
|
|
|
|
|
|
| |
- When creating the handle, write it to store if
not present. Currently it is written to store
only on first bit allocation.
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
| |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
|
|
| |
- 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>
|
| |
|
|
| |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
| |
- incorrect handling during datastore write
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
| |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
| |
- Also add validation for passed ordinal
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
| |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
| |
- bitseq users only need to know Handle type
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
| |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
|
|
| |
- We must ignore key not found error when querying
datastore for initial state.
- Regression introduced by 04bd8f67ad8bcd96e6c9ddf49745d9eea1eae7aa
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In that commit, AtomicPutCreate takes previous = nil to Atomically create keys
that don't exist. We need a create operation that is atomic to prevent races
between multiple libnetworks creating the same object.
Previously, we just created new KVs with an index of 0 and wrote them to the
datastore. Consul accepts this behaviour and interprets index of 0 as
non-existing, but other data backends do no.
- Add Exists() to the KV interface. SetIndex() should also modify a KV so
that it exists.
- Call SetIndex() from within the GetObject() method on DataStore interface.
- This ensures objects have the updated values for exists and index.
- Add SetValue() to the KV interface. This allows implementers to define
their own method to marshall and unmarshall (as bitseq and allocator have).
- Update existing users of the DataStore (endpoint, network, bitseq,
allocator, ov_network) to new interfaces.
- Fix UTs.
|
| |
|
|
|
|
| |
- and do not discard errors
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
| |
- IPAM to use datastore for the subnets configurations
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
|
|
|
|
| |
- At Handle creation, first check if an instance of the
the respective object is already present in the datastore.
- Handle sequence must be saved only if commit
to datastore is succesfull
- Caller (ipam) needs to manage the retry
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
| |
Signed-off-by: Madhu Venugopal <madhu@docker.com>
|
| |
|
|
| |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
| |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
|
|
|
|
| |
- Handle contains sequence and identifier.
This way datastore integration can be done
at bitseq level.
Signed-off-by: Alessandro Boch <aboch@docker.com>
|
| |
|
|
| |
Signed-off-by: Alessandro Boch <aboch@docker.com>
|