Allow both image and build together.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2016-01-12 11:24:06 -05:00
commit e98ab0e534
7 changed files with 121 additions and 102 deletions

View file

@ -151,6 +151,7 @@ def handle_error_for_schema_with_id(error, service_name):
VALID_NAME_CHARS)
if schema_id == '#/definitions/constraints':
# TODO: only applies to v1
if 'image' in error.instance and 'build' in error.instance:
return (
"Service '{}' has both an image and build path specified. "
@ -159,7 +160,8 @@ def handle_error_for_schema_with_id(error, service_name):
if 'image' not in error.instance and 'build' not in error.instance:
return (
"Service '{}' has neither an image nor a build path "
"specified. Exactly one must be provided.".format(service_name))
"specified. At least one must be provided.".format(service_name))
# TODO: only applies to v1
if 'image' in error.instance and 'dockerfile' in error.instance:
return (
"Service '{}' has both an image and alternate Dockerfile. "