mirror of https://github.com/docker/compose.git
iprange -> ip_range
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
05638ab5ea
commit
5aafa54667
|
@ -311,7 +311,7 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"subnet": {"type": "string"},
|
"subnet": {"type": "string"},
|
||||||
"iprange": {"type": "string"},
|
"ip_range": {"type": "string"},
|
||||||
"gateway": {"type": "string"},
|
"gateway": {"type": "string"},
|
||||||
"aux_addresses": {
|
"aux_addresses": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
|
@ -365,7 +365,7 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"subnet": {"type": "string"},
|
"subnet": {"type": "string"},
|
||||||
"iprange": {"type": "string"},
|
"ip_range": {"type": "string"},
|
||||||
"gateway": {"type": "string"},
|
"gateway": {"type": "string"},
|
||||||
"aux_addresses": {
|
"aux_addresses": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
|
@ -374,7 +374,7 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"subnet": {"type": "string"},
|
"subnet": {"type": "string"},
|
||||||
"iprange": {"type": "string"},
|
"ip_range": {"type": "string"},
|
||||||
"gateway": {"type": "string"},
|
"gateway": {"type": "string"},
|
||||||
"aux_addresses": {
|
"aux_addresses": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
|
@ -418,7 +418,7 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"subnet": {"type": "string"},
|
"subnet": {"type": "string"},
|
||||||
"iprange": {"type": "string"},
|
"ip_range": {"type": "string"},
|
||||||
"gateway": {"type": "string"},
|
"gateway": {"type": "string"},
|
||||||
"aux_addresses": {
|
"aux_addresses": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
|
@ -417,7 +417,7 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"subnet": {"type": "string"},
|
"subnet": {"type": "string"},
|
||||||
"iprange": {"type": "string"},
|
"ip_range": {"type": "string"},
|
||||||
"gateway": {"type": "string"},
|
"gateway": {"type": "string"},
|
||||||
"aux_addresses": {
|
"aux_addresses": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
|
@ -1344,6 +1344,38 @@ class ConfigTest(unittest.TestCase):
|
||||||
assert ('networks.foo.ipam.config contains an invalid type,'
|
assert ('networks.foo.ipam.config contains an invalid type,'
|
||||||
' it should be an object') in excinfo.exconly()
|
' it should be an object') in excinfo.exconly()
|
||||||
|
|
||||||
|
def test_config_valid_ipam_config(self):
|
||||||
|
ipam_config = {
|
||||||
|
'subnet': '172.28.0.0/16',
|
||||||
|
'ip_range': '172.28.5.0/24',
|
||||||
|
'gateway': '172.28.5.254',
|
||||||
|
'aux_addresses': {
|
||||||
|
'host1': '172.28.1.5',
|
||||||
|
'host2': '172.28.1.6',
|
||||||
|
'host3': '172.28.1.7',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
networks = config.load(
|
||||||
|
build_config_details(
|
||||||
|
{
|
||||||
|
'version': str(V2_1),
|
||||||
|
'networks': {
|
||||||
|
'foo': {
|
||||||
|
'driver': 'default',
|
||||||
|
'ipam': {
|
||||||
|
'driver': 'default',
|
||||||
|
'config': [ipam_config],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filename='filename.yml',
|
||||||
|
)
|
||||||
|
).networks
|
||||||
|
|
||||||
|
assert 'foo' in networks
|
||||||
|
assert networks['foo']['ipam']['config'] == [ipam_config]
|
||||||
|
|
||||||
def test_config_valid_service_names(self):
|
def test_config_valid_service_names(self):
|
||||||
for valid_name in ['_', '-', '.__.', '_what-up.', 'what_.up----', 'whatup']:
|
for valid_name in ['_', '-', '.__.', '_what-up.', 'what_.up----', 'whatup']:
|
||||||
services = config.load(
|
services = config.load(
|
||||||
|
|
Loading…
Reference in New Issue