Merge pull request #4232 from shin-/attachable_networks
Make created networks attachable for file format >=2.1
This commit is contained in:
commit
ea7b565009
2 changed files with 6 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ import logging
|
||||||
from docker.errors import NotFound
|
from docker.errors import NotFound
|
||||||
from docker.types import IPAMConfig
|
from docker.types import IPAMConfig
|
||||||
from docker.types import IPAMPool
|
from docker.types import IPAMPool
|
||||||
|
from docker.utils import version_gte
|
||||||
|
|
||||||
from .config import ConfigurationError
|
from .config import ConfigurationError
|
||||||
|
|
||||||
|
|
@ -72,6 +73,7 @@ class Network(object):
|
||||||
internal=self.internal,
|
internal=self.internal,
|
||||||
enable_ipv6=self.enable_ipv6,
|
enable_ipv6=self.enable_ipv6,
|
||||||
labels=self.labels,
|
labels=self.labels,
|
||||||
|
attachable=version_gte(self.client._version, '1.24') or None
|
||||||
)
|
)
|
||||||
|
|
||||||
def remove(self):
|
def remove(self):
|
||||||
|
|
|
||||||
|
|
@ -316,8 +316,8 @@ class CLITestCase(DockerClientTestCase):
|
||||||
'memory': '50M',
|
'memory': '50M',
|
||||||
},
|
},
|
||||||
'reservations': {
|
'reservations': {
|
||||||
'cpus': '0.0001',
|
'cpus': '0.0001',
|
||||||
'memory': '20M',
|
'memory': '20M',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'restart_policy': {
|
'restart_policy': {
|
||||||
|
|
@ -928,6 +928,7 @@ class CLITestCase(DockerClientTestCase):
|
||||||
assert foo_container.get('HostConfig.NetworkMode') == \
|
assert foo_container.get('HostConfig.NetworkMode') == \
|
||||||
'container:{}'.format(bar_container.id)
|
'container:{}'.format(bar_container.id)
|
||||||
|
|
||||||
|
@v3_only()
|
||||||
def test_up_with_healthcheck(self):
|
def test_up_with_healthcheck(self):
|
||||||
def wait_on_health_status(container, status):
|
def wait_on_health_status(container, status):
|
||||||
def condition():
|
def condition():
|
||||||
|
|
@ -945,7 +946,7 @@ class CLITestCase(DockerClientTestCase):
|
||||||
assert passes_container.get('Config.Healthcheck') == {
|
assert passes_container.get('Config.Healthcheck') == {
|
||||||
"Test": ["CMD-SHELL", "/bin/true"],
|
"Test": ["CMD-SHELL", "/bin/true"],
|
||||||
"Interval": nanoseconds_from_time_seconds(1),
|
"Interval": nanoseconds_from_time_seconds(1),
|
||||||
"Timeout": nanoseconds_from_time_seconds(30*60),
|
"Timeout": nanoseconds_from_time_seconds(30 * 60),
|
||||||
"Retries": 1,
|
"Retries": 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue