Add "pid" to unsupported options list

Services do not support custom "pid"-modes (e.g. `--pid=host`), but this
option was ignored silently when deploying a stack.

This patch adds `pid` to the list of unsupported options so that a warning
is printed;

With this patch applied:

    $ docker stack deploy -c docker-compose.yml foobar
    Ignoring unsupported options: pid

    Creating network foobar_default
    Creating service foobar_test

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2017-12-27 12:45:19 +01:00
parent a5fe375289
commit 70a29b492d
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 3 additions and 1 deletions

View File

@ -657,6 +657,7 @@ services:
context: ./web context: ./web
links: links:
- bar - bar
pid: host
db: db:
image: db image: db
build: build:
@ -670,7 +671,7 @@ services:
require.NoError(t, err) require.NoError(t, err)
unsupported := GetUnsupportedProperties(configDetails) unsupported := GetUnsupportedProperties(configDetails)
assert.Equal(t, []string{"build", "links"}, unsupported) assert.Equal(t, []string{"build", "links", "pid"}, unsupported)
} }
func TestBuildProperties(t *testing.T) { func TestBuildProperties(t *testing.T) {

View File

@ -17,6 +17,7 @@ var UnsupportedProperties = []string{
"links", "links",
"mac_address", "mac_address",
"network_mode", "network_mode",
"pid",
"privileged", "privileged",
"restart", "restart",
"security_opt", "security_opt",