mirror of https://github.com/docker/compose.git
Merge pull request #2373 from shin-/2370-env_vars_with_dashes
Allow dashes in environment variable names
This commit is contained in:
commit
0a35fd93cd
|
@ -40,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"patternProperties": {
|
"patternProperties": {
|
||||||
"^[^-]+$": {
|
".+": {
|
||||||
"type": ["string", "number", "boolean", "null"],
|
"type": ["string", "number", "boolean", "null"],
|
||||||
"format": "environment"
|
"format": "environment"
|
||||||
}
|
}
|
||||||
|
|
|
@ -480,20 +480,18 @@ class ConfigTest(unittest.TestCase):
|
||||||
self.assertTrue(mock_logging.warn.called)
|
self.assertTrue(mock_logging.warn.called)
|
||||||
self.assertTrue(expected_warning_msg in mock_logging.warn.call_args[0][0])
|
self.assertTrue(expected_warning_msg in mock_logging.warn.call_args[0][0])
|
||||||
|
|
||||||
def test_config_invalid_environment_dict_key_raises_validation_error(self):
|
def test_config_valid_environment_dict_key_contains_dashes(self):
|
||||||
expected_error_msg = "Service 'web' configuration key 'environment' contains unsupported option: '---'"
|
services = config.load(
|
||||||
|
build_config_details(
|
||||||
with self.assertRaisesRegexp(ConfigurationError, expected_error_msg):
|
{'web': {
|
||||||
config.load(
|
'image': 'busybox',
|
||||||
build_config_details(
|
'environment': {'SPRING_JPA_HIBERNATE_DDL-AUTO': 'none'}
|
||||||
{'web': {
|
}},
|
||||||
'image': 'busybox',
|
'working_dir',
|
||||||
'environment': {'---': 'nope'}
|
'filename.yml'
|
||||||
}},
|
|
||||||
'working_dir',
|
|
||||||
'filename.yml'
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
self.assertEqual(services[0]['environment']['SPRING_JPA_HIBERNATE_DDL-AUTO'], 'none')
|
||||||
|
|
||||||
def test_load_yaml_with_yaml_error(self):
|
def test_load_yaml_with_yaml_error(self):
|
||||||
tmpdir = py.test.ensuretemp('invalid_yaml_test')
|
tmpdir = py.test.ensuretemp('invalid_yaml_test')
|
||||||
|
|
Loading…
Reference in New Issue