mirror of
https://github.com/docker/compose.git
synced 2025-07-27 23:54:04 +02:00
Relax constraints on key naming for environment
One of the use cases is swarm requires at least : character, so going from conservative to relaxed. Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
parent
8caeffe27e
commit
4b2fd7699b
@ -39,7 +39,7 @@
|
|||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"patternProperties": {
|
"patternProperties": {
|
||||||
"^[a-zA-Z0-9_]+$": {
|
"^[^-]+$": {
|
||||||
"type": ["string", "number", "boolean"],
|
"type": ["string", "number", "boolean"],
|
||||||
"format": "environment"
|
"format": "environment"
|
||||||
}
|
}
|
||||||
|
@ -287,6 +287,21 @@ 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):
|
||||||
|
expected_error_msg = "Service 'web' configuration key 'environment' contains an invalid type"
|
||||||
|
|
||||||
|
with self.assertRaisesRegexp(ConfigurationError, expected_error_msg):
|
||||||
|
config.load(
|
||||||
|
config.ConfigDetails(
|
||||||
|
{'web': {
|
||||||
|
'image': 'busybox',
|
||||||
|
'environment': {'---': 'nope'}
|
||||||
|
}},
|
||||||
|
'working_dir',
|
||||||
|
'filename.yml'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class InterpolationTest(unittest.TestCase):
|
class InterpolationTest(unittest.TestCase):
|
||||||
@mock.patch.dict(os.environ)
|
@mock.patch.dict(os.environ)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user