-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Introduce new config format with volume support and versioning #2113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
949b425
Introduce validation schema for new config format
shin- d9533b6
Handle new config format when loading config
shin- 1f5996b
Test basic v2 config behavior
shin- 91f7ac2
Upgrade tests to use new Mounts in container inspect.
dnephin c843512
Confine config version check to a single instance
shin- e55ce46
Simplify v2 fields schema
shin- 695b8a6
Return object with volumes and services info in config.load
shin- d154594
Create volumes in compose up phase
shin- 9ad1749
Update tests to support Project changes.
shin- f1464f1
Use API version 1.21 as default
shin- 96d0b8e
Update get_container_data_volumes for 1.20+
shin- 7537bda
Update service tests to use mounts instead of volumes
shin- 9da52df
Update service volume tests to use mounts key
shin- 35bd2b6
Support service named 'version' in legacy format
shin- 92aa818
Fix Project bug when volumes are specified
shin- a719ea3
Add volume integration tests, more config parsing tests
shin- 6793be6
Update docs to define and document new compose.yml file format
shin- 84a9f0e
Fix several post-rebase issues and bugs
shin- bbea675
Fix duplicate requirement
shin- File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-04/schema#", | ||
|
|
||
| "type": "object", | ||
| "properties": { | ||
| "version": { | ||
| "enum": [2] | ||
| }, | ||
| "services": { | ||
| "type": "object", | ||
| "patternProperties": { | ||
| "^[a-zA-Z0-9._-]+$": { | ||
| "$ref": "fields_schema.json#/definitions/service" | ||
| } | ||
| } | ||
| }, | ||
| "volumes": { | ||
| "type": "object", | ||
| "patternProperties": { | ||
| "^[a-zA-Z0-9._-]+$": { | ||
| "$ref": "#/definitions/volume" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
|
|
||
| "definitions": { | ||
| "volume": { | ||
| "type": "object", | ||
| "properties": { | ||
| "driver": {"type": "string"}, | ||
| "driver_opts": { | ||
| "type": "object", | ||
| "patternProperties": { | ||
| "^.+$": {"type": ["boolean", "string", "number"]} | ||
| }, | ||
| "additionalProperties": false | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| from __future__ import unicode_literals | ||
|
|
||
|
|
||
| class Volume(object): | ||
| def __init__(self, client, project, name, driver=None, driver_opts=None): | ||
| self.client = client | ||
| self.project = project | ||
| self.name = name | ||
| self.driver = driver | ||
| self.driver_opts = driver_opts | ||
|
|
||
| def create(self): | ||
| return self.client.create_volume(self.name, self.driver, self.driver_opts) | ||
|
|
||
| def remove(self): | ||
| return self.client.remove_volume(self.name) | ||
|
|
||
| def inspect(self): | ||
| return self.client.inspect_volume(self.name) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, but we'll probably want to do semver here, so maybe a string of "2.0" so the version type is consistent when we increment it