mirror of https://github.com/docker/compose.git
Allow entrypoint to be a list or string
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
parent
9da2bf3973
commit
866979c57b
|
@ -32,7 +32,7 @@
|
||||||
"dns_search": {"$ref": "#/definitions/string_or_list"},
|
"dns_search": {"$ref": "#/definitions/string_or_list"},
|
||||||
"dockerfile": {"type": "string"},
|
"dockerfile": {"type": "string"},
|
||||||
"domainname": {"type": "string"},
|
"domainname": {"type": "string"},
|
||||||
"entrypoint": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"entrypoint": {"$ref": "#/definitions/string_or_list"},
|
||||||
"env_file": {"$ref": "#/definitions/string_or_list"},
|
"env_file": {"$ref": "#/definitions/string_or_list"},
|
||||||
|
|
||||||
"environment": {
|
"environment": {
|
||||||
|
|
|
@ -254,6 +254,21 @@ class ConfigTest(unittest.TestCase):
|
||||||
)
|
)
|
||||||
self.assertEqual(service[0]['expose'], expose)
|
self.assertEqual(service[0]['expose'], expose)
|
||||||
|
|
||||||
|
def test_valid_config_oneof_string_or_list(self):
|
||||||
|
entrypoint_values = [["sh"], "sh"]
|
||||||
|
for entrypoint in entrypoint_values:
|
||||||
|
service = config.load(
|
||||||
|
config.ConfigDetails(
|
||||||
|
{'web': {
|
||||||
|
'image': 'busybox',
|
||||||
|
'entrypoint': entrypoint
|
||||||
|
}},
|
||||||
|
'working_dir',
|
||||||
|
'filename.yml'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
self.assertEqual(service[0]['entrypoint'], entrypoint)
|
||||||
|
|
||||||
|
|
||||||
class InterpolationTest(unittest.TestCase):
|
class InterpolationTest(unittest.TestCase):
|
||||||
@mock.patch.dict(os.environ)
|
@mock.patch.dict(os.environ)
|
||||||
|
|
Loading…
Reference in New Issue