Compare commits
40
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80c8033ede | ||
|
|
5a77b12973 | ||
|
|
df19150f28 | ||
|
|
3083961ff0 | ||
|
|
b18ab30d0e | ||
|
|
c69b9c5296 | ||
|
|
6eb0519584 | ||
|
|
a6dd5c1211 | ||
|
|
0b9f58dd38 | ||
|
|
d191b0309f | ||
|
|
a8731dffeb | ||
|
|
a77efd829e | ||
|
|
7b688ab54a | ||
|
|
228adfcd40 | ||
|
|
02f4c4289a | ||
|
|
f4f23ddb6b | ||
|
|
ae0095d51f | ||
|
|
0d895d041d | ||
|
|
29cb745e30 | ||
|
|
f9cde631a2 | ||
|
|
264ab31364 | ||
|
|
5d7e8f3778 | ||
|
|
74e076ab06 | ||
|
|
184c27d785 | ||
|
|
33d771ed94 | ||
|
|
50e759c017 | ||
|
|
bde1eb8281 | ||
|
|
fb8384a555 | ||
|
|
86127edfd5 | ||
|
|
d2b3575a03 | ||
|
|
d256539bf4 | ||
|
|
fbfecebc0a | ||
|
|
f73a0ff35c | ||
|
|
5f5c42593a | ||
|
|
fcde1eb2b7 | ||
|
|
b52085fc2e | ||
|
|
ee2f9437b6 | ||
|
|
8e51e59c8a | ||
|
|
a4b9862912 | ||
|
|
718cc1a071 |
@@ -1 +1,93 @@
|
||||
# Changelog
|
||||
|
||||
Items starting with `DEPRECATE` are important deprecation notices. For more
|
||||
information on the list of deprecated flags and APIs please have a look at
|
||||
https://docs.docker.com/engine/deprecated/ where target removal dates can also
|
||||
be found.
|
||||
|
||||
## 17.12.0-ce (2017-12-DD)
|
||||
|
||||
|
||||
### Builder
|
||||
|
||||
- Fix build cache hash for broken symlink [moby/moby#34271](https://github.com/moby/moby/pull/34271)
|
||||
- Fix long stream sync [moby/moby#35404](https://github.com/moby/moby/pull/35404)
|
||||
- Fix dockerfile parser failing silently on long tokens [moby/moby#35429](https://github.com/moby/moby/pull/35429)
|
||||
|
||||
### Client
|
||||
|
||||
* Remove secret/config duplication in cli/compose [docker/cli#671](https://github.com/docker/cli/pull/671)
|
||||
* Add `--local` flag to `docker trust sign` [docker/cli#575](https://github.com/docker/cli/pull/575)
|
||||
* Add `docker trust inspect` [docker/cli#694](https://github.com/docker/cli/pull/694)
|
||||
+ Add `name` field to secrets and configs to allow interpolation in Compose files [docker/cli#668](https://github.com/docker/cli/pull/668)
|
||||
+ Add `--isolation` for setting swarm service isolation mode [docker/cli#426](https://github.com/docker/cli/pull/426)
|
||||
* Remove deprecated "daemon" subcommand [docker/cli#689](https://github.com/docker/cli/pull/689)
|
||||
- Fix behaviour of `rmi -f` with unexpected errors [docker/cli#654](https://github.com/docker/cli/pull/654)
|
||||
* Integrated Generic resource in service create [docker/cli#429](https://github.com/docker/cli/pull/429)
|
||||
- Fix external networks in stacks [docker/cli#743](https://github.com/docker/cli/pull/743)
|
||||
|
||||
### Documentation
|
||||
|
||||
* Update API version history for 1.35 [moby/moby#35724](https://github.com/moby/moby/pull/35724)
|
||||
|
||||
### Logging
|
||||
|
||||
* Logentries driver line-only=true []byte output fix [moby/moby#35612](https://github.com/moby/moby/pull/35612)
|
||||
* Logentries line-only logopt fix to maintain backwards compatibility [moby/moby#35628](https://github.com/moby/moby/pull/35628)
|
||||
+ Add `--until` flag for docker logs [moby/moby#32914](https://github.com/moby/moby/pull/32914)
|
||||
+ Add gelf log driver plugin to Windows build [moby/moby#35073](https://github.com/moby/moby/pull/35073)
|
||||
* Set timeout on splunk batch send [moby/moby#35496](https://github.com/moby/moby/pull/35496)
|
||||
* Update Graylog2/go-gelf [moby/moby#35765](https://github.com/moby/moby/pull/35765)
|
||||
|
||||
### Networking
|
||||
|
||||
* Move load balancer sandbox creation/deletion into libnetwork [moby/moby#35422](https://github.com/moby/moby/pull/35422)
|
||||
* Only chown network files within container metadata [moby/moby#34224](https://github.com/moby/moby/pull/34224)
|
||||
* Restore error type in FindNetwork [moby/moby#35634](https://github.com/moby/moby/pull/35634)
|
||||
- Fix consumes MIME type for NetworkConnect [moby/moby#35542](https://github.com/moby/moby/pull/35542)
|
||||
+ Added support for persisting Windows network driver specific options [moby/moby#35563](https://github.com/moby/moby/pull/35563)
|
||||
- Fix timeout on netlink sockets and watchmiss leak [moby/moby#35677](https://github.com/moby/moby/pull/35677)
|
||||
+ New daemon config for networking diagnosis [moby/moby#35677](https://github.com/moby/moby/pull/35677)
|
||||
- Clean up node management logic [docker/libnetwork#2036](https://github.com/docker/libnetwork/pull/2036)
|
||||
|
||||
### Runtime
|
||||
|
||||
* Update to containerd v1.0.0 [moby/moby#35707](https://github.com/moby/moby/pull/35707)
|
||||
* Have VFS graphdriver use accelerated in-kernel copy [moby/moby#35537](https://github.com/moby/moby/pull/35537)
|
||||
* Introduce `workingdir` option for docker exec [moby/moby#35661](https://github.com/moby/moby/pull/35661)
|
||||
* Bump Go to 1.9.2 [moby/moby#33892](https://github.com/moby/moby/pull/33892) [docker/cli#716](https://github.com/docker/cli/pull/716)
|
||||
* `/dev` should not be readonly with `--readonly` flag [moby/moby#35344](https://github.com/moby/moby/pull/35344)
|
||||
+ Add custom build-time Graphdrivers priority list [moby/moby#35522](https://github.com/moby/moby/pull/35522)
|
||||
* LCOW: CLI changes to add platform flag - pull, run, create and build [docker/cli#474](https://github.com/docker/cli/pull/474)
|
||||
* Fix width/height on Windoes for `docker exec` [moby/moby#35631](https://github.com/moby/moby/pull/35631)
|
||||
* Detect overlay2 support on pre-4.0 kernels [moby/moby#35527](https://github.com/moby/moby/pull/35527)
|
||||
* Devicemapper: remove container rootfs mountPath after umount [moby/moby#34573](https://github.com/moby/moby/pull/34573)
|
||||
* Disallow overlay/overlay2 on top of NFS [moby/moby#35483](https://github.com/moby/moby/pull/35483)
|
||||
- Fix potential panic during plugin set. [moby/moby#35632](https://github.com/moby/moby/pull/35632)
|
||||
- Fix some issues with locking on the container [moby/moby#35501](https://github.com/moby/moby/pull/35501)
|
||||
- Fixup some issues with plugin refcounting [moby/moby#35265](https://github.com/moby/moby/pull/35265)
|
||||
+ Add missing lock in ProcessEvent [moby/moby#35516](https://github.com/moby/moby/pull/35516)
|
||||
+ Add vfs quota support [moby/moby#35231](https://github.com/moby/moby/pull/35231)
|
||||
* Skip empty directories on prior graphdriver detection [moby/moby#35528](https://github.com/moby/moby/pull/35528)
|
||||
* Skip xfs quota tests when running in user namespace [moby/moby#35526](https://github.com/moby/moby/pull/35526)
|
||||
+ Added SubSecondPrecision to config option. [moby/moby#35529](https://github.com/moby/moby/pull/35529)
|
||||
* Update fsnotify to fix deadlock in removing watch [moby/moby#35453](https://github.com/moby/moby/pull/35453)
|
||||
- Fix "duplicate mount point" when `--tmpfs /dev/shm` is used [moby/moby#35467](https://github.com/moby/moby/pull/35467)
|
||||
- Fix honoring tmpfs-size for user `/dev/shm` mount [moby/moby#35316](https://github.com/moby/moby/pull/35316)
|
||||
- Fix EBUSY errors under overlayfs and v4.13+ kernels [moby/moby#34948](https://github.com/moby/moby/pull/34948)
|
||||
* Container: protect health monitor channel [moby/moby#35482](https://github.com/moby/moby/pull/35482)
|
||||
* Container: protect the health status with mutex [moby/moby#35517](https://github.com/moby/moby/pull/35517)
|
||||
* Container: update real-time resources [moby/moby#33731](https://github.com/moby/moby/pull/33731)
|
||||
* Create labels when volume exists only remotely [moby/moby#34896](https://github.com/moby/moby/pull/34896)
|
||||
- Fix leaking container/exec state [moby/moby#35484](https://github.com/moby/moby/pull/35484)
|
||||
* Disallow using legacy (v1) registries [moby/moby#35751](https://github.com/moby/moby/pull/35751) and [docker/cli#747](https://github.com/docker/cli/pull/747)
|
||||
|
||||
### Swarm Mode
|
||||
|
||||
+ Added support for swarm service isolation mode [moby/moby#34424](https://github.com/moby/moby/pull/34424)
|
||||
|
||||
### Packaging
|
||||
|
||||
+ Add Packaging for Fedora 27 [docker/docker-ce-packaging#59](https://github.com/docker/docker-ce-packaging/pull/59)
|
||||
* Change default versioning scheme to 0.0.0-dev unless specified for packaging [docker/docker-ce-packaging#67](https://github.com/docker/docker-ce-packaging/pull/67)
|
||||
* Pass Version to engine static builds [docker/docker-ce-packaging#70](https://github.com/docker/docker-ce-packaging/pull/70)
|
||||
|
||||
@@ -1 +1 @@
|
||||
17.12.0-dev
|
||||
17.12.0-ce-rc3
|
||||
|
||||
@@ -62,7 +62,7 @@ func Networks(namespace Namespace, networks networkMap, servicesNetworks map[str
|
||||
for internalName := range servicesNetworks {
|
||||
network := networks[internalName]
|
||||
if network.External.External {
|
||||
externalNetworks = append(externalNetworks, network.External.Name)
|
||||
externalNetworks = append(externalNetworks, network.Name)
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -55,10 +55,8 @@ func TestNetworks(t *testing.T) {
|
||||
},
|
||||
},
|
||||
"outside": composetypes.NetworkConfig{
|
||||
External: composetypes.External{
|
||||
External: true,
|
||||
Name: "special",
|
||||
},
|
||||
External: composetypes.External{External: true},
|
||||
Name: "special",
|
||||
},
|
||||
"attachablenet": composetypes.NetworkConfig{
|
||||
Driver: "overlay",
|
||||
|
||||
@@ -230,7 +230,7 @@ func convertServiceNetworks(
|
||||
}
|
||||
target := namespace.Scope(networkName)
|
||||
if networkConfig.External.External {
|
||||
target = networkConfig.External.Name
|
||||
target = networkConfig.Name
|
||||
}
|
||||
netAttachConfig := swarm.NetworkAttachmentConfig{
|
||||
Target: target,
|
||||
|
||||
@@ -219,10 +219,8 @@ func TestConvertServiceNetworksOnlyDefault(t *testing.T) {
|
||||
func TestConvertServiceNetworks(t *testing.T) {
|
||||
networkConfigs := networkMap{
|
||||
"front": composetypes.NetworkConfig{
|
||||
External: composetypes.External{
|
||||
External: true,
|
||||
Name: "fronttier",
|
||||
},
|
||||
External: composetypes.External{External: true},
|
||||
Name: "fronttier",
|
||||
},
|
||||
"back": composetypes.NetworkConfig{},
|
||||
}
|
||||
@@ -259,10 +257,8 @@ func TestConvertServiceNetworks(t *testing.T) {
|
||||
func TestConvertServiceNetworksCustomDefault(t *testing.T) {
|
||||
networkConfigs := networkMap{
|
||||
"default": composetypes.NetworkConfig{
|
||||
External: composetypes.External{
|
||||
External: true,
|
||||
Name: "custom",
|
||||
},
|
||||
External: composetypes.External{External: true},
|
||||
Name: "custom",
|
||||
},
|
||||
}
|
||||
networks := map[string]*composetypes.ServiceNetworkConfig{}
|
||||
|
||||
@@ -2164,7 +2164,6 @@ _docker_create() {
|
||||
_docker_daemon() {
|
||||
local boolean_options="
|
||||
$global_boolean_options
|
||||
--disable-legacy-registry
|
||||
--experimental
|
||||
--help
|
||||
--icc=false
|
||||
|
||||
@@ -2633,7 +2633,6 @@ __docker_subcommand() {
|
||||
"($help)--default-gateway-v6[Container default gateway IPv6 address]:IPv6 address: " \
|
||||
"($help)--default-shm-size=[Default shm size for containers]:size:" \
|
||||
"($help)*--default-ulimit=[Default ulimits for containers]:ulimit: " \
|
||||
"($help)--disable-legacy-registry[Disable contacting legacy registries (default true)]" \
|
||||
"($help)*--dns=[DNS server to use]:DNS: " \
|
||||
"($help)*--dns-opt=[DNS options to use]:DNS option: " \
|
||||
"($help)*--dns-search=[DNS search domains to use]:DNS search: " \
|
||||
|
||||
@@ -88,10 +88,10 @@ The daemon is moved to a separate binary (`dockerd`), and should be used instead
|
||||
### Duplicate keys with conflicting values in engine labels
|
||||
**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**
|
||||
|
||||
**Target For Removal In Release: v17.12**
|
||||
**Removed In Release: v17.12**
|
||||
|
||||
Duplicate keys with conflicting values have been deprecated. A warning is displayed
|
||||
in the output, and an error will be returned in the future.
|
||||
When setting duplicate keys with conflicting values, an error will be produced, and the daemon
|
||||
will fail to start.
|
||||
|
||||
### `MAINTAINER` in Dockerfile
|
||||
**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**
|
||||
@@ -110,12 +110,16 @@ future Engine versions. Instead of just requesting, for example, the URL
|
||||
### Backing filesystem without `d_type` support for overlay/overlay2
|
||||
**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**
|
||||
|
||||
**Target For Removal In Release: v17.12**
|
||||
**Removed In Release: v17.12**
|
||||
|
||||
The overlay and overlay2 storage driver does not work as expected if the backing
|
||||
filesystem does not support `d_type`. For example, XFS does not support `d_type`
|
||||
if it is formatted with the `ftype=0` option.
|
||||
|
||||
Starting with Docker 17.12, new installations will not support running overlay2 on
|
||||
a backing filesystem without `d_type` support. For existing installations that upgrade
|
||||
to 17.12, a warning will be printed.
|
||||
|
||||
Please also refer to [#27358](https://github.com/docker/docker/issues/27358) for
|
||||
further information.
|
||||
|
||||
@@ -292,7 +296,7 @@ of the `--changes` flag that allows to pass `Dockerfile` commands.
|
||||
|
||||
**Disabled By Default In Release: v17.06**
|
||||
|
||||
**Target For Removal In Release: v17.12**
|
||||
**Removed In Release: v17.12**
|
||||
|
||||
Version 1.8.3 added a flag (`--disable-legacy-registry=false`) which prevents the
|
||||
docker daemon from `pull`, `push`, and `login` operations against v1
|
||||
@@ -303,6 +307,21 @@ Support for the v1 protocol to the public registry was removed in 1.13. Any
|
||||
mirror configurations using v1 should be updated to use a
|
||||
[v2 registry mirror](https://docs.docker.com/registry/recipes/mirror/).
|
||||
|
||||
Starting with Docker 17.12, support for V1 registries has been removed, and the
|
||||
`--disable-legacy-registry` flag can no longer be used, and `dockerd` will fail to
|
||||
start when set.
|
||||
|
||||
### `--disable-legacy-registry` override daemon option
|
||||
|
||||
**Disabled In Release: v17.12**
|
||||
|
||||
**Target For Removal In Release: v18.03**
|
||||
|
||||
The `--disable-legacy-registry` flag was disabled in Docker 17.12 and will print
|
||||
an error when used. For this error to be printed, the flag itself is still present,
|
||||
but hidden. The flag will be removed in Docker 18.03.
|
||||
|
||||
|
||||
### Docker Content Trust ENV passphrase variables name change
|
||||
**Deprecated In Release: [v1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0)**
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ Options:
|
||||
--default-gateway-v6 ip Container default gateway IPv6 address
|
||||
--default-runtime string Default OCI runtime for containers (default "runc")
|
||||
--default-ulimit ulimit Default ulimits for containers (default [])
|
||||
--disable-legacy-registry Disable contacting legacy registries (default true)
|
||||
--dns list DNS server to use (default [])
|
||||
--dns-opt list DNS options to use (default [])
|
||||
--dns-search list DNS search domains to use (default [])
|
||||
@@ -263,7 +262,7 @@ snapshots. For each devicemapper graph location – typically
|
||||
`/var/lib/docker/devicemapper` – a thin pool is created based on two block
|
||||
devices, one for data and one for metadata. By default, these block devices
|
||||
are created automatically by using loopback mounts of automatically created
|
||||
sparse files. Refer to [Storage driver options](#storage-driver-options) below
|
||||
sparse files. Refer to [Devicemapper options](#devicemapper-options) below
|
||||
for a way how to customize this setup.
|
||||
[~jpetazzo/Resizing Docker containers with the Device Mapper plugin](http://jpetazzo.github.io/2014/01/29/docker-device-mapper-resize/)
|
||||
article explains how to tune your existing setup without the use of options.
|
||||
@@ -275,7 +274,7 @@ does not share executable memory between devices. Use
|
||||
The `zfs` driver is probably not as fast as `btrfs` but has a longer track record
|
||||
on stability. Thanks to `Single Copy ARC` shared blocks between clones will be
|
||||
cached only once. Use `dockerd -s zfs`. To select a different zfs filesystem
|
||||
set `zfs.fsname` option as described in [Storage driver options](#storage-driver-options).
|
||||
set `zfs.fsname` option as described in [ZFS options](#zfs-options).
|
||||
|
||||
The `overlay` is a very fast union filesystem. It is now merged in the main
|
||||
Linux kernel as of [3.18.0](https://lkml.org/lkml/2014/10/26/137). `overlay`
|
||||
@@ -1054,18 +1053,14 @@ system's list of trusted CAs instead of enabling `--insecure-registry`.
|
||||
|
||||
#### Legacy Registries
|
||||
|
||||
Operations against registries supporting only the legacy v1 protocol are
|
||||
disabled by default. Specifically, the daemon will not attempt `push`,
|
||||
`pull` and `login` to v1 registries. The exception to this is `search`
|
||||
which can still be performed on v1 registries.
|
||||
Starting with Docker 17.12, operations against registries supporting only the
|
||||
legacy v1 protocol are no longer supported. Specifically, the daemon will not
|
||||
attempt `push`, `pull` and `login` to v1 registries. The exception to this is
|
||||
`search` which can still be performed on v1 registries.
|
||||
|
||||
Add `"disable-legacy-registry":false` to the [daemon configuration
|
||||
file](#daemon-configuration-file), or set the
|
||||
`--disable-legacy-registry=false` flag, if you need to interact with
|
||||
registries that have not yet migrated to the v2 protocol.
|
||||
The `disable-legacy-registry` configuration option has been removed and, when
|
||||
used, will produce an error on daemon startup.
|
||||
|
||||
Interaction v1 registries will no longer be supported in Docker v17.12,
|
||||
and the `disable-legacy-registry` configuration option will be removed.
|
||||
|
||||
### Running a Docker daemon behind an HTTPS_PROXY
|
||||
|
||||
@@ -1339,7 +1334,6 @@ This is a full example of the allowed configuration options on Linux:
|
||||
"registry-mirrors": [],
|
||||
"seccomp-profile": "",
|
||||
"insecure-registries": [],
|
||||
"disable-legacy-registry": false,
|
||||
"no-new-privileges": false,
|
||||
"default-runtime": "runc",
|
||||
"oom-score-adjust": -500,
|
||||
@@ -1408,8 +1402,7 @@ This is a full example of the allowed configuration options on Windows:
|
||||
"raw-logs": false,
|
||||
"allow-nondistributable-artifacts": [],
|
||||
"registry-mirrors": [],
|
||||
"insecure-registries": [],
|
||||
"disable-legacy-registry": false
|
||||
"insecure-registries": []
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -739,7 +739,7 @@ Containers on the same network can access each other using
|
||||
You can publish service ports to make them available externally to the swarm
|
||||
using the `--publish` flag. The `--publish` flag can take two different styles
|
||||
of arguments. The short version is positional, and allows you to specify the
|
||||
target port and container port separated by a colon.
|
||||
published port and target port separated by a colon.
|
||||
|
||||
```bash
|
||||
$ docker service create --name my_web --replicas 3 --publish 8080:80 nginx
|
||||
@@ -751,7 +751,7 @@ mode when using the short format. Here is an example of using the long format
|
||||
for the same service as above:
|
||||
|
||||
```bash
|
||||
$ docker service create --name my_web --replicas 3 --publish target=8080,port=80 nginx
|
||||
$ docker service create --name my_web --replicas 3 --publish published=8080,target=80 nginx
|
||||
```
|
||||
|
||||
The options you can specify are:
|
||||
@@ -765,7 +765,7 @@ The options you can specify are:
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>target and container port </td>
|
||||
<td>published and target port </td>
|
||||
<td><tt></tt></td>
|
||||
<td><tt></tt></td>
|
||||
<td></td>
|
||||
@@ -773,16 +773,16 @@ The options you can specify are:
|
||||
<tr>
|
||||
<td>protocol</td>
|
||||
<td><tt>--publish 8080:80</tt></td>
|
||||
<td><tt>--publish target=8080,port=80</tt></td>
|
||||
<td><tt>--publish published=8080,target=80</tt></td>
|
||||
<td><p>
|
||||
The container port to publish and the target port to bind it to on the
|
||||
routing mesh or directly on the node.
|
||||
The port to publish the service to on the routing mesh or directly on
|
||||
the node, and the target port on the container.
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mode</td>
|
||||
<td>Not possible to set using short syntax.</td>
|
||||
<td><tt>--publish target=8080,port=80,mode=host</tt></td>
|
||||
<td><tt>--publish published=8080,target=80,mode=host</tt></td>
|
||||
<td><p>
|
||||
The mode to use for binding the port, either `ingress` or `host`. Defaults
|
||||
to `ingress` to use the routing mesh.
|
||||
@@ -791,7 +791,7 @@ The options you can specify are:
|
||||
<tr>
|
||||
<td>protocol</td>
|
||||
<td><tt>--publish 8080:80/tcp</tt></td>
|
||||
<td><tt>--publish target=8080,port=80,protocol=tcp</tt></td>
|
||||
<td><tt>--publish published=8080,target=80,protocol=tcp</tt></td>
|
||||
<td><p>
|
||||
The protocol to use, either `tcp` or `udp`. Defaults to `tcp`. To bind a
|
||||
port for both protocols, specify the `-p` or `--publish` flag twice.
|
||||
@@ -800,7 +800,7 @@ The options you can specify are:
|
||||
</table>
|
||||
|
||||
When you publish a service port using `ingres` mode, the swarm routing mesh
|
||||
makes the service accessible at the target port on every node regardless if
|
||||
makes the service accessible at the published port on every node regardless if
|
||||
there is a task for the service running on the node. If you use `host` mode,
|
||||
the port is only bound on nodes where the service is running, and a given port
|
||||
on a node can only be bound once. You can only set the publication mode using
|
||||
|
||||
@@ -177,18 +177,18 @@ $ docker service update --mount-rm /somewhere myservice
|
||||
myservice
|
||||
```
|
||||
|
||||
### Add or remove port mappings
|
||||
### Add or remove published service ports
|
||||
|
||||
Use the `--port-add` or `--port-rm` flags to add or remove port mappings to or
|
||||
from a service. You can use the short or long syntax discussed in the
|
||||
[docker service update](service_create/#attach-a-service-to-an-existing-network-network)
|
||||
Use the `--publish-add` or `--publish-rm` flags to add or remove a published
|
||||
port for a service. You can use the short or long syntax discussed in the
|
||||
[docker service create](service_create/#attach-a-service-to-an-existing-network-network)
|
||||
reference.
|
||||
|
||||
The following example adds a port mapping to an existing service.
|
||||
The following example adds a published service port to an existing service.
|
||||
|
||||
```bash
|
||||
$ docker service update \
|
||||
--port-add port=80,target=8080 \
|
||||
--publish-add published=8080,target=80 \
|
||||
myservice
|
||||
```
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ dockerd - Enable daemon mode
|
||||
[**--default-ipc-mode**=*MODE*]
|
||||
[**--default-shm-size**[=*64MiB*]]
|
||||
[**--default-ulimit**[=*[]*]]
|
||||
[**--disable-legacy-registry**]
|
||||
[**--dns**[=*[]*]]
|
||||
[**--dns-opt**[=*[]*]]
|
||||
[**--dns-search**[=*[]*]]
|
||||
@@ -197,9 +196,6 @@ $ sudo dockerd --add-runtime runc=runc --add-runtime custom=/usr/local/bin/my-ru
|
||||
**--default-ulimit**=[]
|
||||
Default ulimits for containers.
|
||||
|
||||
**--disable-legacy-registry**=*true*|*false*
|
||||
Disable contacting legacy registries. Default is `true`.
|
||||
|
||||
**--dns**=""
|
||||
Force Docker to use specific DNS servers
|
||||
|
||||
|
||||
@@ -92,6 +92,8 @@ func installRegistryServiceFlags(options *registry.ServiceOptions, flags *pflag.
|
||||
flags.Var(insecureRegistries, "insecure-registry", "Enable insecure registry communication")
|
||||
|
||||
if runtime.GOOS != "windows" {
|
||||
// TODO: Remove this flag after 3 release cycles (18.03)
|
||||
flags.BoolVar(&options.V2Only, "disable-legacy-registry", true, "Disable contacting legacy registries")
|
||||
flags.MarkHidden("disable-legacy-registry")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -472,8 +473,15 @@ func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !conf.V2Only {
|
||||
logrus.Warnf(`The "disable-legacy-registry" option is deprecated and wil be removed in Docker v17.12. Interacting with legacy (v1) registries will no longer be supported in Docker v17.12"`)
|
||||
if runtime.GOOS != "windows" {
|
||||
if flags.Changed("disable-legacy-registry") {
|
||||
// TODO: Remove this error after 3 release cycles (18.03)
|
||||
return nil, errors.New("ERROR: The '--disable-legacy-registry' flag has been removed. Interacting with legacy (v1) registries is no longer supported")
|
||||
}
|
||||
if !conf.V2Only {
|
||||
// TODO: Remove this error after 3 release cycles (18.03)
|
||||
return nil, errors.New("ERROR: The 'disable-legacy-registry' configuration option has been removed. Interacting with legacy (v1) registries is no longer supported")
|
||||
}
|
||||
}
|
||||
|
||||
if flags.Changed("graph") {
|
||||
|
||||
@@ -97,15 +97,3 @@ func TestLoadDaemonConfigWithTrueDefaultValuesLeaveDefaults(t *testing.T) {
|
||||
|
||||
assert.True(t, loadedConfig.EnableUserlandProxy)
|
||||
}
|
||||
|
||||
func TestLoadDaemonConfigWithLegacyRegistryOptions(t *testing.T) {
|
||||
content := `{"disable-legacy-registry": false}`
|
||||
tempFile := fs.NewFile(t, "config", fs.WithContent(content))
|
||||
defer tempFile.Remove()
|
||||
|
||||
opts := defaultOptions(tempFile.Path())
|
||||
loadedConfig, err := loadDaemonCliConfig(opts)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, loadedConfig)
|
||||
assert.False(t, loadedConfig.V2Only)
|
||||
}
|
||||
|
||||
@@ -23,6 +23,18 @@ keywords: "API, Docker, rcli, REST, documentation"
|
||||
configuration is only used for Windows containers.
|
||||
* `GET /containers/(name)/logs` now supports an additional query parameter: `until`,
|
||||
which returns log lines that occurred before the specified timestamp.
|
||||
* `POST /containers/{id}/exec` now accepts a `WorkingDir` property to set the
|
||||
work-dir for the exec process, independent of the container's work-dir.
|
||||
* `Get /version` now returns a `Platform.Name` field, which can be used by products
|
||||
using Moby as a foundation to return information about the platform.
|
||||
* `Get /version` now returns a `Components` field, which can be used to return
|
||||
information about the components used. Information about the engine itself is
|
||||
now included as a "Component" version, and contains all information from the
|
||||
top-level `Version`, `GitCommit`, `APIVersion`, `MinAPIVersion`, `GoVersion`,
|
||||
`Os`, `Arch`, `BuildTime`, `KernelVersion`, and `Experimental` fields. Going
|
||||
forward, the information from the `Components` section is preferred over their
|
||||
top-level counterparts.
|
||||
|
||||
|
||||
## v1.34 API changes
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ TOMLV_COMMIT=9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
|
||||
|
||||
# When updating RUNC_COMMIT, also update runc in vendor.conf accordingly
|
||||
RUNC_COMMIT=b2567b37d7b75eb4cf325b77297b140ea686ce8f
|
||||
CONTAINERD_COMMIT=v1.0.0
|
||||
CONTAINERD_COMMIT=89623f28b87a6004d4b785663257362d1658a729 # v1.0.0
|
||||
TINI_COMMIT=949e6facb77383876aeff8a6944dde66b3089574
|
||||
LIBNETWORK_COMMIT=7b2b1feb1de4817d522cc372af149ff48d25028e
|
||||
VNDR_COMMIT=a6e196d8b4b0cbbdc29aebdb20c59ac6926bb384
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"fmt"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/docker/docker/integration-cli/checker"
|
||||
"github.com/docker/docker/integration-cli/request"
|
||||
@@ -48,25 +45,6 @@ func (s *DockerSuite) TestInfoAPI(c *check.C) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestInfoAPIRuncCommit tests that dockerd is able to obtain RunC version
|
||||
// information, and that the version matches the expected version
|
||||
func (s *DockerSuite) TestInfoAPIRuncCommit(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux) // Windows does not have RunC version information
|
||||
|
||||
res, body, err := request.Get("/v1.30/info")
|
||||
c.Assert(res.StatusCode, checker.Equals, http.StatusOK)
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
b, err := request.ReadBody(body)
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
var i types.Info
|
||||
|
||||
c.Assert(json.Unmarshal(b, &i), checker.IsNil)
|
||||
c.Assert(i.RuncCommit.ID, checker.Not(checker.Equals), "N/A")
|
||||
c.Assert(i.RuncCommit.ID, checker.Equals, i.RuncCommit.Expected)
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestInfoAPIVersioned(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux) // Windows only supports 1.25 or later
|
||||
|
||||
|
||||
@@ -4211,6 +4211,7 @@ func (s *DockerTrustSuite) TestBuildContextDirIsSymlink(c *check.C) {
|
||||
}
|
||||
|
||||
func (s *DockerTrustSuite) TestTrustedBuildTagFromReleasesRole(c *check.C) {
|
||||
c.Skip("Blacklisting for Docker CE")
|
||||
testRequires(c, NotaryHosting)
|
||||
|
||||
latestTag := s.setupTrustedImage(c, "trusted-build-releases-role")
|
||||
@@ -4242,6 +4243,7 @@ func (s *DockerTrustSuite) TestTrustedBuildTagFromReleasesRole(c *check.C) {
|
||||
}
|
||||
|
||||
func (s *DockerTrustSuite) TestTrustedBuildTagIgnoresOtherDelegationRoles(c *check.C) {
|
||||
c.Skip("Blacklisting for Docker CE")
|
||||
testRequires(c, NotaryHosting)
|
||||
|
||||
latestTag := s.setupTrustedImage(c, "trusted-build-releases-role")
|
||||
|
||||
@@ -13,9 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func (s *DockerRegistryAuthHtpasswdSuite) TestLogoutWithExternalAuth(c *check.C) {
|
||||
|
||||
// @TODO TestLogoutWithExternalAuth expects docker to fall back to a v1 registry, so has to be updated for v17.12, when v1 registries are no longer supported
|
||||
s.d.StartWithBusybox(c, "--disable-legacy-registry=false")
|
||||
s.d.StartWithBusybox(c)
|
||||
|
||||
osPath := os.Getenv("PATH")
|
||||
defer os.Setenv("PATH", osPath)
|
||||
@@ -62,7 +60,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestLogoutWithExternalAuth(c *check.C)
|
||||
// check I cannot pull anymore
|
||||
out, err := s.d.Cmd("--config", tmp, "pull", repoName)
|
||||
c.Assert(err, check.NotNil, check.Commentf(out))
|
||||
c.Assert(out, checker.Contains, "Error: image dockercli/busybox:authtest not found")
|
||||
c.Assert(out, checker.Contains, "no basic auth credentials")
|
||||
}
|
||||
|
||||
// #23100
|
||||
|
||||
@@ -259,18 +259,6 @@ func (s *DockerHubPullSuite) TestPullClientDisconnect(c *check.C) {
|
||||
c.Assert(err, checker.NotNil, check.Commentf("image was pulled after client disconnected"))
|
||||
}
|
||||
|
||||
func (s *DockerRegistryAuthHtpasswdSuite) TestPullNoCredentialsNotFound(c *check.C) {
|
||||
// @TODO TestPullNoCredentialsNotFound expects docker to fall back to a v1 registry, so has to be updated for v17.12, when v1 registries are no longer supported
|
||||
s.d.StartWithBusybox(c, "--disable-legacy-registry=false")
|
||||
|
||||
// we don't care about the actual image, we just want to see image not found
|
||||
// because that means v2 call returned 401 and we fell back to v1 which usually
|
||||
// gives a 404 (in this case the test registry doesn't handle v1 at all)
|
||||
out, err := s.d.Cmd("pull", privateRegistryURL+"/busybox")
|
||||
c.Assert(err, check.NotNil, check.Commentf(out))
|
||||
c.Assert(out, checker.Contains, "Error: image busybox:latest not found")
|
||||
}
|
||||
|
||||
// Regression test for https://github.com/docker/docker/issues/26429
|
||||
func (s *DockerSuite) TestPullLinuxImageFailsOnWindows(c *check.C) {
|
||||
testRequires(c, DaemonIsWindows, Network)
|
||||
|
||||
@@ -133,6 +133,7 @@ func (s *DockerTrustSuite) TestTrustedPullDelete(c *check.C) {
|
||||
}
|
||||
|
||||
func (s *DockerTrustSuite) TestTrustedPullReadsFromReleasesRole(c *check.C) {
|
||||
c.Skip("Blacklisting for Docker CE")
|
||||
testRequires(c, NotaryHosting)
|
||||
repoName := fmt.Sprintf("%v/dockerclireleasesdelegationpulling/trusted", privateRegistryURL)
|
||||
targetName := fmt.Sprintf("%s:latest", repoName)
|
||||
@@ -188,6 +189,7 @@ func (s *DockerTrustSuite) TestTrustedPullReadsFromReleasesRole(c *check.C) {
|
||||
}
|
||||
|
||||
func (s *DockerTrustSuite) TestTrustedPullIgnoresOtherDelegationRoles(c *check.C) {
|
||||
c.Skip("Blacklisting for Docker CE")
|
||||
testRequires(c, NotaryHosting)
|
||||
repoName := fmt.Sprintf("%v/dockerclipullotherdelegation/trusted", privateRegistryURL)
|
||||
targetName := fmt.Sprintf("%s:latest", repoName)
|
||||
|
||||
@@ -282,6 +282,7 @@ func (s *DockerSchema1RegistrySuite) TestCrossRepositoryLayerPushNotSupported(c
|
||||
}
|
||||
|
||||
func (s *DockerTrustSuite) TestTrustedPush(c *check.C) {
|
||||
c.Skip("Blacklisting for Docker CE")
|
||||
repoName := fmt.Sprintf("%v/dockerclitrusted/pushtest:latest", privateRegistryURL)
|
||||
// tag the image and upload it to the private registry
|
||||
cli.DockerCmd(c, "tag", "busybox", repoName)
|
||||
@@ -366,6 +367,7 @@ func (s *DockerTrustSuite) TestTrustedPushWithExistingSignedTag(c *check.C) {
|
||||
}
|
||||
|
||||
func (s *DockerTrustSuite) TestTrustedPushWithIncorrectPassphraseForNonRoot(c *check.C) {
|
||||
c.Skip("Blacklisting for Docker CE")
|
||||
repoName := fmt.Sprintf("%v/dockercliincorretpwd/trusted:latest", privateRegistryURL)
|
||||
// tag the image and upload it to the private registry
|
||||
cli.DockerCmd(c, "tag", "busybox", repoName)
|
||||
|
||||
@@ -22,7 +22,7 @@ func makefile(path string, contents string) (string, error) {
|
||||
return f.Name(), nil
|
||||
}
|
||||
|
||||
// TestV2Only ensures that a daemon by default does not
|
||||
// TestV2Only ensures that a daemon does not
|
||||
// attempt to contact any v1 registry endpoints.
|
||||
func (s *DockerRegistrySuite) TestV2Only(c *check.C) {
|
||||
reg, err := registry.NewMock(c)
|
||||
@@ -56,65 +56,3 @@ func (s *DockerRegistrySuite) TestV2Only(c *check.C) {
|
||||
s.d.Cmd("push", repoName)
|
||||
s.d.Cmd("pull", repoName)
|
||||
}
|
||||
|
||||
// TestV1 starts a daemon with legacy registries enabled
|
||||
// and ensure v1 endpoints are hit for the following operations:
|
||||
// login, push, pull, build & run
|
||||
func (s *DockerRegistrySuite) TestV1(c *check.C) {
|
||||
reg, err := registry.NewMock(c)
|
||||
defer reg.Close()
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
v2Pings := 0
|
||||
reg.RegisterHandler("/v2/", func(w http.ResponseWriter, r *http.Request) {
|
||||
v2Pings++
|
||||
// V2 ping 404 causes fallback to v1
|
||||
w.WriteHeader(404)
|
||||
})
|
||||
|
||||
v1Pings := 0
|
||||
reg.RegisterHandler("/v1/_ping", func(w http.ResponseWriter, r *http.Request) {
|
||||
v1Pings++
|
||||
})
|
||||
|
||||
v1Logins := 0
|
||||
reg.RegisterHandler("/v1/users/", func(w http.ResponseWriter, r *http.Request) {
|
||||
v1Logins++
|
||||
})
|
||||
|
||||
v1Repo := 0
|
||||
reg.RegisterHandler("/v1/repositories/busybox/", func(w http.ResponseWriter, r *http.Request) {
|
||||
v1Repo++
|
||||
})
|
||||
|
||||
reg.RegisterHandler("/v1/repositories/busybox/images", func(w http.ResponseWriter, r *http.Request) {
|
||||
v1Repo++
|
||||
})
|
||||
|
||||
s.d.Start(c, "--insecure-registry", reg.URL(), "--disable-legacy-registry=false")
|
||||
|
||||
tmp, err := ioutil.TempDir("", "integration-cli-")
|
||||
c.Assert(err, check.IsNil)
|
||||
defer os.RemoveAll(tmp)
|
||||
|
||||
dockerfileName, err := makefile(tmp, fmt.Sprintf("FROM %s/busybox", reg.URL()))
|
||||
c.Assert(err, check.IsNil, check.Commentf("Unable to create test dockerfile"))
|
||||
|
||||
s.d.Cmd("build", "--file", dockerfileName, tmp)
|
||||
c.Assert(v1Repo, check.Equals, 1, check.Commentf("Expected v1 repository access after build"))
|
||||
|
||||
repoName := fmt.Sprintf("%s/busybox", reg.URL())
|
||||
s.d.Cmd("run", repoName)
|
||||
c.Assert(v1Repo, check.Equals, 2, check.Commentf("Expected v1 repository access after run"))
|
||||
|
||||
s.d.Cmd("login", "-u", "richard", "-p", "testtest", reg.URL())
|
||||
c.Assert(v1Logins, check.Equals, 1, check.Commentf("Expected v1 login attempt"))
|
||||
|
||||
s.d.Cmd("tag", "busybox", repoName)
|
||||
s.d.Cmd("push", repoName)
|
||||
|
||||
c.Assert(v1Repo, check.Equals, 2)
|
||||
|
||||
s.d.Cmd("pull", repoName)
|
||||
c.Assert(v1Repo, check.Equals, 3, check.Commentf("Expected v1 repository access after pull"))
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ const notaryHost = "localhost:4443"
|
||||
const notaryURL = "https://" + notaryHost
|
||||
|
||||
var SuccessTagging = icmd.Expected{
|
||||
Out: "Tagging",
|
||||
Err: "Tagging",
|
||||
}
|
||||
|
||||
var SuccessSigningAndPushing = icmd.Expected{
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// +build !windows
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/integration/util/request"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func TestInfo_BinaryCommits(t *testing.T) {
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
info, err := client.Info(context.Background())
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.NotNil(t, info.ContainerdCommit)
|
||||
assert.NotEqual(t, "N/A", info.ContainerdCommit.ID)
|
||||
assert.Equal(t, testEnv.DaemonInfo.ContainerdCommit.Expected, info.ContainerdCommit.Expected)
|
||||
assert.Equal(t, info.ContainerdCommit.Expected, info.ContainerdCommit.ID)
|
||||
|
||||
assert.NotNil(t, info.InitCommit)
|
||||
assert.NotEqual(t, "N/A", info.InitCommit.ID)
|
||||
assert.Equal(t, testEnv.DaemonInfo.InitCommit.Expected, info.InitCommit.Expected)
|
||||
assert.Equal(t, info.InitCommit.Expected, info.InitCommit.ID)
|
||||
|
||||
assert.NotNil(t, info.RuncCommit)
|
||||
assert.NotEqual(t, "N/A", info.RuncCommit.ID)
|
||||
assert.Equal(t, testEnv.DaemonInfo.RuncCommit.Expected, info.RuncCommit.Expected)
|
||||
assert.Equal(t, info.RuncCommit.Expected, info.RuncCommit.ID)
|
||||
}
|
||||
@@ -30,7 +30,7 @@ github.com/moby/buildkit aaff9d591ef128560018433fe61beb802e149de8
|
||||
github.com/tonistiigi/fsutil dea3a0da73aee887fc02142d995be764106ac5e2
|
||||
|
||||
#get libnetwork packages
|
||||
github.com/docker/libnetwork 9bca9a4a220b158cc94402e0f8c2c7714eb6f503
|
||||
github.com/docker/libnetwork 7dd202d11b2078c063fefc614c9fb9e4615da0e1
|
||||
github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
|
||||
github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80
|
||||
github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec
|
||||
@@ -77,7 +77,7 @@ github.com/syndtr/gocapability 2c00daeb6c3b45114c80ac44119e7b8801fdd852
|
||||
github.com/golang/protobuf 7a211bcf3bce0e3f1d74f9894916e6f116ae83b4
|
||||
|
||||
# gelf logging driver deps
|
||||
github.com/Graylog2/go-gelf v2
|
||||
github.com/Graylog2/go-gelf 4143646226541087117ff2f83334ea48b3201841
|
||||
|
||||
github.com/fluent/fluent-logger-golang v1.3.0
|
||||
# fluent-logger-golang deps
|
||||
@@ -103,7 +103,7 @@ github.com/googleapis/gax-go da06d194a00e19ce00d9011a13931c3f6f6887c7
|
||||
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
|
||||
|
||||
# containerd
|
||||
github.com/containerd/containerd v1.0.0
|
||||
github.com/containerd/containerd 89623f28b87a6004d4b785663257362d1658a729 # v1.0.0
|
||||
github.com/containerd/fifo fbfb6a11ec671efbe94ad1c12c2e98773f19e1e6
|
||||
github.com/containerd/continuity 35d55c5e8dd23b32037d56cf97174aff3efdfa83
|
||||
github.com/containerd/cgroups 29da22c6171a4316169f9205ab6c49f59b5b852f
|
||||
@@ -148,7 +148,7 @@ github.com/opencontainers/selinux b29023b86e4a69d1b46b7e7b4e2b6fda03f0b9cd
|
||||
# archive/tar
|
||||
# mkdir -p ./vendor/archive
|
||||
# git clone git://github.com/tonistiigi/go-1.git ./go
|
||||
# git --git-dir ./go/.git --work-tree ./go checkout revert-prefix-ignore
|
||||
# git --git-dir ./go/.git --work-tree ./go checkout revert-prefix-ignore-1.9
|
||||
# cp -a go/src/archive/tar ./vendor/archive/tar
|
||||
# rm -rf ./go
|
||||
# vndr
|
||||
|
||||
+9
-11
@@ -158,11 +158,15 @@ func (fi headerFileInfo) Mode() (mode os.FileMode) {
|
||||
// sysStat, if non-nil, populates h from system-dependent fields of fi.
|
||||
var sysStat func(fi os.FileInfo, h *Header) error
|
||||
|
||||
// Mode constants from the tar spec.
|
||||
const (
|
||||
c_ISUID = 04000 // Set uid
|
||||
c_ISGID = 02000 // Set gid
|
||||
c_ISVTX = 01000 // Save text (sticky bit)
|
||||
// Mode constants from the USTAR spec:
|
||||
// See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06
|
||||
c_ISUID = 04000 // Set uid
|
||||
c_ISGID = 02000 // Set gid
|
||||
c_ISVTX = 01000 // Save text (sticky bit)
|
||||
|
||||
// Common Unix mode constants; these are not defined in any common tar standard.
|
||||
// Header.FileInfo understands these, but FileInfoHeader will never produce these.
|
||||
c_ISDIR = 040000 // Directory
|
||||
c_ISFIFO = 010000 // FIFO
|
||||
c_ISREG = 0100000 // Regular file
|
||||
@@ -208,30 +212,24 @@ func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) {
|
||||
}
|
||||
switch {
|
||||
case fm.IsRegular():
|
||||
h.Mode |= c_ISREG
|
||||
h.Typeflag = TypeReg
|
||||
h.Size = fi.Size()
|
||||
case fi.IsDir():
|
||||
h.Typeflag = TypeDir
|
||||
h.Mode |= c_ISDIR
|
||||
h.Name += "/"
|
||||
case fm&os.ModeSymlink != 0:
|
||||
h.Typeflag = TypeSymlink
|
||||
h.Mode |= c_ISLNK
|
||||
h.Linkname = link
|
||||
case fm&os.ModeDevice != 0:
|
||||
if fm&os.ModeCharDevice != 0 {
|
||||
h.Mode |= c_ISCHR
|
||||
h.Typeflag = TypeChar
|
||||
} else {
|
||||
h.Mode |= c_ISBLK
|
||||
h.Typeflag = TypeBlock
|
||||
}
|
||||
case fm&os.ModeNamedPipe != 0:
|
||||
h.Typeflag = TypeFifo
|
||||
h.Mode |= c_ISFIFO
|
||||
case fm&os.ModeSocket != 0:
|
||||
h.Mode |= c_ISSOCK
|
||||
return nil, fmt.Errorf("archive/tar: sockets not supported")
|
||||
default:
|
||||
return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm)
|
||||
}
|
||||
|
||||
+8
-2
@@ -121,9 +121,15 @@ func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error {
|
||||
needsPaxHeader := paxKeyword != paxNone && len(s) > len(b) || !isASCII(s)
|
||||
if needsPaxHeader {
|
||||
paxHeaders[paxKeyword] = s
|
||||
return
|
||||
}
|
||||
f.formatString(b, s)
|
||||
|
||||
// Write string in a best-effort manner to satisfy readers that expect
|
||||
// the field to be non-empty.
|
||||
s = toASCII(s)
|
||||
if len(s) > len(b) {
|
||||
s = s[:len(b)]
|
||||
}
|
||||
f.formatString(b, s) // Should never error
|
||||
}
|
||||
var formatNumeric = func(b []byte, x int64, paxKeyword string) {
|
||||
// Try octal first.
|
||||
|
||||
+80
-17
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
type TCPReader struct {
|
||||
@@ -13,16 +14,21 @@ type TCPReader struct {
|
||||
messages chan []byte
|
||||
}
|
||||
|
||||
func newTCPReader(addr string) (*TCPReader, chan string, error) {
|
||||
type connChannels struct {
|
||||
drop chan string
|
||||
confirm chan string
|
||||
}
|
||||
|
||||
func newTCPReader(addr string) (*TCPReader, chan string, chan string, error) {
|
||||
var err error
|
||||
tcpAddr, err := net.ResolveTCPAddr("tcp", addr)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("ResolveTCPAddr('%s'): %s", addr, err)
|
||||
return nil, nil, nil, fmt.Errorf("ResolveTCPAddr('%s'): %s", addr, err)
|
||||
}
|
||||
|
||||
listener, err := net.ListenTCP("tcp", tcpAddr)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("ListenTCP: %s", err)
|
||||
return nil, nil, nil, fmt.Errorf("ListenTCP: %s", err)
|
||||
}
|
||||
|
||||
r := &TCPReader{
|
||||
@@ -30,26 +36,61 @@ func newTCPReader(addr string) (*TCPReader, chan string, error) {
|
||||
messages: make(chan []byte, 100), // Make a buffered channel with at most 100 messages
|
||||
}
|
||||
|
||||
signal := make(chan string, 1)
|
||||
closeSignal := make(chan string, 1)
|
||||
doneSignal := make(chan string, 1)
|
||||
|
||||
go r.listenUntilCloseSignal(signal)
|
||||
go r.listenUntilCloseSignal(closeSignal, doneSignal)
|
||||
|
||||
return r, signal, nil
|
||||
return r, closeSignal, doneSignal, nil
|
||||
}
|
||||
|
||||
func (r *TCPReader) listenUntilCloseSignal(signal chan string) {
|
||||
defer func() { signal <- "done" }()
|
||||
defer r.listener.Close()
|
||||
func (r *TCPReader) accepter(connections chan net.Conn) {
|
||||
for {
|
||||
conn, err := r.listener.Accept()
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
go handleConnection(conn, r.messages)
|
||||
connections <- conn
|
||||
}
|
||||
}
|
||||
|
||||
func (r *TCPReader) listenUntilCloseSignal(closeSignal chan string, doneSignal chan string) {
|
||||
defer func() { doneSignal <- "done" }()
|
||||
defer r.listener.Close()
|
||||
var conns []connChannels
|
||||
connectionsChannel := make(chan net.Conn, 1)
|
||||
go r.accepter(connectionsChannel)
|
||||
for {
|
||||
select {
|
||||
case sig := <-signal:
|
||||
if sig == "stop" {
|
||||
break
|
||||
case conn := <-connectionsChannel:
|
||||
dropSignal := make(chan string, 1)
|
||||
dropConfirm := make(chan string, 1)
|
||||
channels := connChannels{drop: dropSignal, confirm: dropConfirm}
|
||||
go handleConnection(conn, r.messages, dropSignal, dropConfirm)
|
||||
conns = append(conns, channels)
|
||||
default:
|
||||
}
|
||||
|
||||
select {
|
||||
case sig := <-closeSignal:
|
||||
if sig == "stop" || sig == "drop" {
|
||||
if len(conns) >= 1 {
|
||||
for _, s := range conns {
|
||||
if s.drop != nil {
|
||||
s.drop <- "drop"
|
||||
<-s.confirm
|
||||
conns = append(conns[:0], conns[1:]...)
|
||||
}
|
||||
}
|
||||
if sig == "stop" {
|
||||
return
|
||||
}
|
||||
} else if sig == "stop" {
|
||||
closeSignal <- "stop"
|
||||
}
|
||||
if sig == "drop" {
|
||||
doneSignal <- "done"
|
||||
}
|
||||
}
|
||||
default:
|
||||
}
|
||||
@@ -60,19 +101,41 @@ func (r *TCPReader) addr() string {
|
||||
return r.listener.Addr().String()
|
||||
}
|
||||
|
||||
func handleConnection(conn net.Conn, messages chan<- []byte) {
|
||||
func handleConnection(conn net.Conn, messages chan<- []byte, dropSignal chan string, dropConfirm chan string) {
|
||||
defer func() { dropConfirm <- "done" }()
|
||||
defer conn.Close()
|
||||
reader := bufio.NewReader(conn)
|
||||
|
||||
var b []byte
|
||||
var err error
|
||||
drop := false
|
||||
canDrop := false
|
||||
|
||||
for {
|
||||
conn.SetDeadline(time.Now().Add(2 * time.Second))
|
||||
if b, err = reader.ReadBytes(0); err != nil {
|
||||
continue
|
||||
}
|
||||
if len(b) > 0 {
|
||||
if drop {
|
||||
return
|
||||
}
|
||||
} else if len(b) > 0 {
|
||||
messages <- b
|
||||
canDrop = true
|
||||
if drop {
|
||||
return
|
||||
}
|
||||
} else if drop {
|
||||
return
|
||||
}
|
||||
select {
|
||||
case sig := <-dropSignal:
|
||||
if sig == "drop" {
|
||||
drop = true
|
||||
time.Sleep(1 * time.Second)
|
||||
if canDrop {
|
||||
return
|
||||
}
|
||||
}
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-2
@@ -75,12 +75,17 @@ func (w *TCPWriter) Write(p []byte) (n int, err error) {
|
||||
|
||||
func (w *TCPWriter) writeToSocketWithReconnectAttempts(zBytes []byte) (n int, err error) {
|
||||
var errConn error
|
||||
var i int
|
||||
|
||||
w.mu.Lock()
|
||||
for i := 0; n <= w.MaxReconnect; i++ {
|
||||
for i = 0; i <= w.MaxReconnect; i++ {
|
||||
errConn = nil
|
||||
|
||||
n, err = w.conn.Write(zBytes)
|
||||
if w.conn != nil {
|
||||
n, err = w.conn.Write(zBytes)
|
||||
} else {
|
||||
err = fmt.Errorf("Connection was nil, will attempt reconnect")
|
||||
}
|
||||
if err != nil {
|
||||
time.Sleep(w.ReconnectDelay * time.Second)
|
||||
w.conn, errConn = net.Dial("tcp", w.addr)
|
||||
@@ -90,6 +95,9 @@ func (w *TCPWriter) writeToSocketWithReconnectAttempts(zBytes []byte) (n int, er
|
||||
}
|
||||
w.mu.Unlock()
|
||||
|
||||
if i > w.MaxReconnect {
|
||||
return 0, fmt.Errorf("Maximum reconnection attempts was reached; giving up")
|
||||
}
|
||||
if errConn != nil {
|
||||
return 0, fmt.Errorf("Write Failed: %s\nReconnection failed: %s", err, errConn)
|
||||
}
|
||||
|
||||
+3
@@ -27,5 +27,8 @@ type GelfWriter struct {
|
||||
|
||||
// Close connection and interrupt blocked Read or Write operations
|
||||
func (w *GelfWriter) Close() error {
|
||||
if w.conn == nil {
|
||||
return nil
|
||||
}
|
||||
return w.conn.Close()
|
||||
}
|
||||
|
||||
+1
-2
@@ -91,7 +91,7 @@ func (s *Server) EnableDebug(ip string, port int) {
|
||||
}
|
||||
|
||||
logrus.Infof("Starting the diagnose server listening on %d for commands", port)
|
||||
srv := &http.Server{Addr: fmt.Sprintf("127.0.0.1:%d", port), Handler: s}
|
||||
srv := &http.Server{Addr: fmt.Sprintf("%s:%d", ip, port), Handler: s}
|
||||
s.srv = srv
|
||||
s.enable = 1
|
||||
go func(n *Server) {
|
||||
@@ -101,7 +101,6 @@ func (s *Server) EnableDebug(ip string, port int) {
|
||||
atomic.SwapInt32(&n.enable, 0)
|
||||
}
|
||||
}(s)
|
||||
|
||||
}
|
||||
|
||||
// DisableDebug stop the dubug and closes the tcp socket
|
||||
|
||||
+23
-54
@@ -16,46 +16,28 @@ func (d *delegate) NodeMeta(limit int) []byte {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
// getNode searches the node inside the tables
|
||||
// returns true if the node was respectively in the active list, explicit node leave list or failed list
|
||||
func (nDB *NetworkDB) getNode(nEvent *NodeEvent, extract bool) (bool, bool, bool, *node) {
|
||||
var active bool
|
||||
var left bool
|
||||
var failed bool
|
||||
|
||||
for _, nodes := range []map[string]*node{
|
||||
nDB.failedNodes,
|
||||
nDB.leftNodes,
|
||||
nDB.nodes,
|
||||
} {
|
||||
if n, ok := nodes[nEvent.NodeName]; ok {
|
||||
active = &nodes == &nDB.nodes
|
||||
left = &nodes == &nDB.leftNodes
|
||||
failed = &nodes == &nDB.failedNodes
|
||||
if n.ltime >= nEvent.LTime {
|
||||
return active, left, failed, nil
|
||||
}
|
||||
if extract {
|
||||
delete(nodes, n.Name)
|
||||
}
|
||||
return active, left, failed, n
|
||||
}
|
||||
}
|
||||
return active, left, failed, nil
|
||||
}
|
||||
|
||||
func (nDB *NetworkDB) handleNodeEvent(nEvent *NodeEvent) bool {
|
||||
// Update our local clock if the received messages has newer
|
||||
// time.
|
||||
nDB.networkClock.Witness(nEvent.LTime)
|
||||
|
||||
nDB.RLock()
|
||||
active, left, _, n := nDB.getNode(nEvent, false)
|
||||
defer nDB.RUnlock()
|
||||
|
||||
// check if the node exists
|
||||
n, _, _ := nDB.findNode(nEvent.NodeName)
|
||||
if n == nil {
|
||||
nDB.RUnlock()
|
||||
return false
|
||||
}
|
||||
nDB.RUnlock()
|
||||
|
||||
// check if the event is fresh
|
||||
if n.ltime >= nEvent.LTime {
|
||||
return false
|
||||
}
|
||||
|
||||
// If we are here means that the event is fresher and the node is known. Update the laport time
|
||||
n.ltime = nEvent.LTime
|
||||
|
||||
// If it is a node leave event for a manager and this is the only manager we
|
||||
// know of we want the reconnect logic to kick in. In a single manager
|
||||
// cluster manager's gossip can't be bootstrapped unless some other node
|
||||
@@ -63,45 +45,32 @@ func (nDB *NetworkDB) handleNodeEvent(nEvent *NodeEvent) bool {
|
||||
if len(nDB.bootStrapIP) == 1 && nEvent.Type == NodeEventTypeLeave {
|
||||
for _, ip := range nDB.bootStrapIP {
|
||||
if ip.Equal(n.Addr) {
|
||||
n.ltime = nEvent.LTime
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
n.ltime = nEvent.LTime
|
||||
|
||||
switch nEvent.Type {
|
||||
case NodeEventTypeJoin:
|
||||
if active {
|
||||
// the node is already marked as active nothing to do
|
||||
moved, err := nDB.changeNodeState(n.Name, nodeActiveState)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("unable to find the node to move")
|
||||
return false
|
||||
}
|
||||
nDB.Lock()
|
||||
// Because the lock got released on the previous check we have to do it again and re verify the status of the node
|
||||
// All of this is to avoid a big lock on the function
|
||||
if active, _, _, n = nDB.getNode(nEvent, true); !active && n != nil {
|
||||
n.reapTime = 0
|
||||
nDB.nodes[n.Name] = n
|
||||
if moved {
|
||||
logrus.Infof("%v(%v): Node join event for %s/%s", nDB.config.Hostname, nDB.config.NodeID, n.Name, n.Addr)
|
||||
}
|
||||
nDB.Unlock()
|
||||
return true
|
||||
return moved
|
||||
case NodeEventTypeLeave:
|
||||
if left {
|
||||
// the node is already marked as left nothing to do.
|
||||
moved, err := nDB.changeNodeState(n.Name, nodeLeftState)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("unable to find the node to move")
|
||||
return false
|
||||
}
|
||||
nDB.Lock()
|
||||
// Because the lock got released on the previous check we have to do it again and re verify the status of the node
|
||||
// All of this is to avoid a big lock on the function
|
||||
if _, left, _, n = nDB.getNode(nEvent, true); !left && n != nil {
|
||||
n.reapTime = nodeReapInterval
|
||||
nDB.leftNodes[n.Name] = n
|
||||
if moved {
|
||||
logrus.Infof("%v(%v): Node leave event for %s/%s", nDB.config.Hostname, nDB.config.NodeID, n.Name, n.Addr)
|
||||
}
|
||||
nDB.Unlock()
|
||||
return true
|
||||
return moved
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
Generated
Vendored
+17
-44
@@ -21,24 +21,6 @@ func (e *eventDelegate) broadcastNodeEvent(addr net.IP, op opType) {
|
||||
}
|
||||
}
|
||||
|
||||
func (e *eventDelegate) purgeReincarnation(mn *memberlist.Node) {
|
||||
for name, node := range e.nDB.failedNodes {
|
||||
if node.Addr.Equal(mn.Addr) {
|
||||
logrus.Infof("Node %s/%s, is the new incarnation of the failed node %s/%s", mn.Name, mn.Addr, name, node.Addr)
|
||||
delete(e.nDB.failedNodes, name)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
for name, node := range e.nDB.leftNodes {
|
||||
if node.Addr.Equal(mn.Addr) {
|
||||
logrus.Infof("Node %s/%s, is the new incarnation of the shutdown node %s/%s", mn.Name, mn.Addr, name, node.Addr)
|
||||
delete(e.nDB.leftNodes, name)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (e *eventDelegate) NotifyJoin(mn *memberlist.Node) {
|
||||
logrus.Infof("Node %s/%s, joined gossip cluster", mn.Name, mn.Addr)
|
||||
e.broadcastNodeEvent(mn.Addr, opCreate)
|
||||
@@ -57,44 +39,35 @@ func (e *eventDelegate) NotifyJoin(mn *memberlist.Node) {
|
||||
// Every node has a unique ID
|
||||
// Check on the base of the IP address if the new node that joined is actually a new incarnation of a previous
|
||||
// failed or shutdown one
|
||||
e.purgeReincarnation(mn)
|
||||
e.nDB.purgeReincarnation(mn)
|
||||
|
||||
e.nDB.nodes[mn.Name] = &node{Node: *mn}
|
||||
logrus.Infof("Node %s/%s, added to nodes list", mn.Name, mn.Addr)
|
||||
}
|
||||
|
||||
func (e *eventDelegate) NotifyLeave(mn *memberlist.Node) {
|
||||
var failed bool
|
||||
logrus.Infof("Node %s/%s, left gossip cluster", mn.Name, mn.Addr)
|
||||
e.broadcastNodeEvent(mn.Addr, opDelete)
|
||||
// The node left or failed, delete all the entries created by it.
|
||||
// If the node was temporary down, deleting the entries will guarantee that the CREATE events will be accepted
|
||||
// If the node instead left because was going down, then it makes sense to just delete all its state
|
||||
|
||||
e.nDB.Lock()
|
||||
defer e.nDB.Unlock()
|
||||
e.nDB.deleteNodeFromNetworks(mn.Name)
|
||||
e.nDB.deleteNodeTableEntries(mn.Name)
|
||||
if n, ok := e.nDB.nodes[mn.Name]; ok {
|
||||
delete(e.nDB.nodes, mn.Name)
|
||||
|
||||
// Check if a new incarnation of the same node already joined
|
||||
// In that case this node can simply be removed and no further action are needed
|
||||
for name, node := range e.nDB.nodes {
|
||||
if node.Addr.Equal(mn.Addr) {
|
||||
logrus.Infof("Node %s/%s, is the new incarnation of the failed node %s/%s", name, node.Addr, mn.Name, mn.Addr)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// In case of node failure, keep retrying to reconnect every retryInterval (1sec) for nodeReapInterval (24h)
|
||||
// Explicit leave will have already removed the node from the list of nodes (nDB.nodes) and put it into the leftNodes map
|
||||
n.reapTime = nodeReapInterval
|
||||
e.nDB.failedNodes[mn.Name] = n
|
||||
failed = true
|
||||
n, currState, _ := e.nDB.findNode(mn.Name)
|
||||
if n == nil {
|
||||
logrus.Errorf("Node %s/%s not found in the node lists", mn.Name, mn.Addr)
|
||||
return
|
||||
}
|
||||
|
||||
if failed {
|
||||
logrus.Infof("Node %s/%s, added to failed nodes list", mn.Name, mn.Addr)
|
||||
// if the node was active means that did not send the leave cluster message, so it's probable that
|
||||
// failed. Else would be already in the left list so nothing else has to be done
|
||||
if currState == nodeActiveState {
|
||||
moved, err := e.nDB.changeNodeState(mn.Name, nodeFailedState)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Errorf("impossible condition, node %s/%s not present in the list", mn.Name, mn.Addr)
|
||||
return
|
||||
}
|
||||
if moved {
|
||||
logrus.Infof("Node %s/%s, added to failed nodes list", mn.Name, mn.Addr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+1
@@ -399,6 +399,7 @@ func dbGetTable(ctx interface{}, w http.ResponseWriter, r *http.Request) {
|
||||
Value: encodedValue,
|
||||
Owner: v.owner,
|
||||
})
|
||||
i++
|
||||
}
|
||||
log.WithField("response", fmt.Sprintf("%+v", rsp)).Info("get table done")
|
||||
diagnose.HTTPReply(w, diagnose.CommandSucceed(rsp), json)
|
||||
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package networkdb
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/memberlist"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type nodeState int
|
||||
|
||||
const (
|
||||
nodeNotFound nodeState = -1
|
||||
nodeActiveState nodeState = 0
|
||||
nodeLeftState nodeState = 1
|
||||
nodeFailedState nodeState = 2
|
||||
)
|
||||
|
||||
var nodeStateName = map[nodeState]string{
|
||||
-1: "NodeNotFound",
|
||||
0: "NodeActive",
|
||||
1: "NodeLeft",
|
||||
2: "NodeFailed",
|
||||
}
|
||||
|
||||
// findNode search the node into the 3 node lists and returns the node pointer and the list
|
||||
// where it got found
|
||||
func (nDB *NetworkDB) findNode(nodeName string) (*node, nodeState, map[string]*node) {
|
||||
for i, nodes := range []map[string]*node{
|
||||
nDB.nodes,
|
||||
nDB.leftNodes,
|
||||
nDB.failedNodes,
|
||||
} {
|
||||
if n, ok := nodes[nodeName]; ok {
|
||||
return n, nodeState(i), nodes
|
||||
}
|
||||
}
|
||||
return nil, nodeNotFound, nil
|
||||
}
|
||||
|
||||
// changeNodeState changes the state of the node specified, returns true if the node was moved,
|
||||
// false if there was no need to change the node state. Error will be returned if the node does not
|
||||
// exists
|
||||
func (nDB *NetworkDB) changeNodeState(nodeName string, newState nodeState) (bool, error) {
|
||||
n, currState, m := nDB.findNode(nodeName)
|
||||
if n == nil {
|
||||
return false, fmt.Errorf("node %s not found", nodeName)
|
||||
}
|
||||
|
||||
switch newState {
|
||||
case nodeActiveState:
|
||||
if currState == nodeActiveState {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
delete(m, nodeName)
|
||||
// reset the node reap time
|
||||
n.reapTime = 0
|
||||
nDB.nodes[nodeName] = n
|
||||
case nodeLeftState:
|
||||
if currState == nodeLeftState {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
delete(m, nodeName)
|
||||
nDB.leftNodes[nodeName] = n
|
||||
case nodeFailedState:
|
||||
if currState == nodeFailedState {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
delete(m, nodeName)
|
||||
nDB.failedNodes[nodeName] = n
|
||||
}
|
||||
|
||||
logrus.Infof("Node %s change state %s --> %s", nodeName, nodeStateName[currState], nodeStateName[newState])
|
||||
|
||||
if newState == nodeLeftState || newState == nodeFailedState {
|
||||
// set the node reap time, if not already set
|
||||
// It is possible that a node passes from failed to left and the reaptime was already set so keep that value
|
||||
if n.reapTime == 0 {
|
||||
n.reapTime = nodeReapInterval
|
||||
}
|
||||
// The node leave or fails, delete all the entries created by it.
|
||||
// If the node was temporary down, deleting the entries will guarantee that the CREATE events will be accepted
|
||||
// If the node instead left because was going down, then it makes sense to just delete all its state
|
||||
nDB.deleteNodeFromNetworks(n.Name)
|
||||
nDB.deleteNodeTableEntries(n.Name)
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (nDB *NetworkDB) purgeReincarnation(mn *memberlist.Node) bool {
|
||||
for name, node := range nDB.nodes {
|
||||
if node.Addr.Equal(mn.Addr) && node.Port == mn.Port && mn.Name != name {
|
||||
logrus.Infof("Node %s/%s, is the new incarnation of the active node %s/%s", mn.Name, mn.Addr, name, node.Addr)
|
||||
nDB.changeNodeState(name, nodeLeftState)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
for name, node := range nDB.failedNodes {
|
||||
if node.Addr.Equal(mn.Addr) && node.Port == mn.Port && mn.Name != name {
|
||||
logrus.Infof("Node %s/%s, is the new incarnation of the failed node %s/%s", mn.Name, mn.Addr, name, node.Addr)
|
||||
nDB.changeNodeState(name, nodeLeftState)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
for name, node := range nDB.leftNodes {
|
||||
if node.Addr.Equal(mn.Addr) && node.Port == mn.Port && mn.Name != name {
|
||||
logrus.Infof("Node %s/%s, is the new incarnation of the shutdown node %s/%s", mn.Name, mn.Addr, name, node.Addr)
|
||||
nDB.changeNodeState(name, nodeLeftState)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
SHELL:=/bin/bash
|
||||
ENGINE_DIR:=$(CURDIR)/../engine
|
||||
CLI_DIR:=$(CURDIR)/../cli
|
||||
VERSION=unknown
|
||||
VERSION?=0.0.0-dev
|
||||
DOCKER_GITCOMMIT:=abcdefg
|
||||
|
||||
.PHONY: help clean rpm deb static
|
||||
|
||||
@@ -3,7 +3,7 @@ ARCH:=$(shell uname -m)
|
||||
ENGINE_DIR:=$(CURDIR)/../../engine
|
||||
CLI_DIR:=$(CURDIR)/../../cli
|
||||
GITCOMMIT?=$(shell cd $(ENGINE_DIR) && git rev-parse --short HEAD)
|
||||
VERSION?=$(shell cat $(ENGINE_DIR)/VERSION)
|
||||
VERSION?=0.0.0-dev
|
||||
DOCKER_EXPERIMENTAL:=0
|
||||
CHOWN:=docker run --rm -v $(CURDIR):/v -w /v alpine chown
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ ARCH=$(shell uname -m)
|
||||
ENGINE_DIR:=$(CURDIR)/../../engine
|
||||
CLI_DIR:=$(CURDIR)/../../cli
|
||||
GITCOMMIT=$(shell cd $(ENGINE_DIR) && git rev-parse --short HEAD)
|
||||
VERSION=$(shell cat $(ENGINE_DIR)/VERSION)
|
||||
VERSION?=0.0.0-dev
|
||||
DOCKER_EXPERIMENTAL=0
|
||||
GEN_RPM_VER=$(shell ./gen-rpm-ver $(ENGINE_DIR) $(VERSION))
|
||||
CHOWN=docker run --rm -i -v $(CURDIR):/v -w /v alpine chown
|
||||
|
||||
@@ -15,6 +15,7 @@ Packager: Docker <support@docker.com>
|
||||
%global _dwz_low_mem_die_limit 0
|
||||
%global is_systemd 1
|
||||
%global with_selinux 1
|
||||
%global _missing_build_ids_terminate_build 0
|
||||
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
SHELL:=/bin/bash
|
||||
ENGINE_DIR:=$(CURDIR)/../../engine
|
||||
CLI_DIR:=$(CURDIR)/../../cli
|
||||
VERSION=$(shell cat $(ENGINE_DIR)/VERSION)
|
||||
VERSION?=0.0.0-dev
|
||||
CHOWN=docker run --rm -v $(CURDIR):/v -w /v alpine chown
|
||||
HASH_CMD=docker run -v $(CURDIR):/sum -w /sum debian:jessie bash hash_files
|
||||
DIR_TO_HASH:=build/linux
|
||||
@@ -50,10 +50,10 @@ static-cli:
|
||||
$(MAKE) -C $(CLI_DIR) -f docker.Makefile VERSION=$(VERSION) build
|
||||
|
||||
static-engine:
|
||||
$(MAKE) -C $(ENGINE_DIR) binary
|
||||
$(MAKE) -C $(ENGINE_DIR) VERSION=$(VERSION) binary
|
||||
|
||||
cross-all-cli:
|
||||
$(MAKE) -C $(CLI_DIR) -f docker.Makefile VERSION=$(VERSION) cross
|
||||
|
||||
cross-win-engine:
|
||||
$(MAKE) -C $(ENGINE_DIR) DOCKER_CROSSPLATFORMS=windows/amd64 cross
|
||||
$(MAKE) -C $(ENGINE_DIR) VERSION=$(VERSION) DOCKER_CROSSPLATFORMS=windows/amd64 cross
|
||||
|
||||
Reference in New Issue
Block a user