Skip to content

Validate expose - #2464

Merged
aanand merged 5 commits into
docker:masterfrom
aanand:validate-expose
Nov 27, 2015
Merged

aanand merged 5 commits into
docker:masterfrom
aanand:validate-expose

Conversation

@aanand

@aanand aanand commented Nov 26, 2015

Copy link
Copy Markdown

I made a bunch of fixes and refactorings to ports validation before implementing expose validation - see the commit log.

Closes #2406.

We were essentially only testing that *at least one* of the invalid
values fails the validation check, rather than that *all* of them fail.

Signed-off-by: Aanand Prasad <[email protected]>
- The `raises` kwarg to the `cls_check` decorator was being used
  incorrectly (it should be an exception class, not an object).

- We need to check for `error.cause` and get the message out of the
  exception object.

NB: The particular case where validation fails in the case of `ports` is
only when ranges don't match in length - no further validation is
currently performed client-side.

Signed-off-by: Aanand Prasad <[email protected]>
@aanand aanand changed the title Validate expose Validate expose Nov 26, 2015
@dnephin

dnephin commented Nov 26, 2015

Copy link
Copy Markdown

LGTM

aanand added a commit that referenced this pull request Nov 27, 2015
@aanand
aanand merged commit defcf5a into docker:master Nov 27, 2015
@aanand
aanand deleted the validate-expose branch November 27, 2015 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate the format of expose

3 participants