'file' key can be omitted from extends
If the 'file' key is not set in the extends_options dict then we look for the 'service' from within the same file. Fixes this issue: https://github.com/docker/compose/issues/1237 Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
parent
31dedd8bdd
commit
6e4a954dbd
3 changed files with 39 additions and 1 deletions
|
|
@ -447,6 +447,30 @@ class ExtendsTest(unittest.TestCase):
|
|||
dictionary['extends']['what'] = 'is this'
|
||||
self.assertRaisesRegexp(config.ConfigurationError, 'what', load_config)
|
||||
|
||||
def test_extends_file_defaults_to_self(self):
|
||||
"""
|
||||
Test not specifying a file in our extends options that the
|
||||
config is valid and correctly extends from itself.
|
||||
"""
|
||||
service_dicts = config.load('tests/fixtures/extends/no-file-specified.yml')
|
||||
self.assertEqual(service_dicts, [
|
||||
{
|
||||
'name': 'myweb',
|
||||
'image': 'busybox',
|
||||
'environment': {
|
||||
"BAR": "1",
|
||||
"BAZ": "3",
|
||||
}
|
||||
},
|
||||
{
|
||||
'name': 'web',
|
||||
'image': 'busybox',
|
||||
'environment': {
|
||||
"BAZ": "3",
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
def test_blacklisted_options(self):
|
||||
def load_config():
|
||||
return config.make_service_dict('myweb', {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue