-
Notifications
You must be signed in to change notification settings - Fork 658
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
Expand LXD driver functionality #1436
Changes from 1 commit
d62c4ea
038c512
cae3eff
c046ad8
2394c5b
2d50359
6ed927d
b12752e
9a6ed00
d307ad4
f9441c4
221fceb
8a99924
f9b0eec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -710,6 +710,85 @@ def pre_validate_base_schema(env, keep_string): | |
}, | ||
} | ||
|
||
platforms_lxd_schema = { | ||
'platforms': { | ||
'type': 'list', | ||
'schema': { | ||
'type': 'dict', | ||
'schema': { | ||
'name': { | ||
'type': 'string', | ||
}, | ||
'url': { | ||
'type': 'string', | ||
}, | ||
'cert_file': { | ||
'type': 'string', | ||
}, | ||
'key_file': { | ||
'type': 'string', | ||
}, | ||
'trust_password': { | ||
'type': 'string', | ||
}, | ||
'source': { | ||
'type': 'dict', | ||
'schema': { | ||
'type': { | ||
'type': 'string', | ||
}, | ||
'mode': { | ||
'type': 'string', | ||
'allowed': [ | ||
'pull', | ||
'local', | ||
], | ||
}, | ||
'server': { | ||
'type': 'string', | ||
}, | ||
'protocol': { | ||
'type': 'string', | ||
'allowed': [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made the schema as specific as possible, these are the only values valid for the LXD api. There are now allowed values (source). |
||
'lxd', | ||
'simplestreams', | ||
], | ||
}, | ||
'alias': { | ||
'type': 'string', | ||
}, | ||
}, | ||
}, | ||
'architecture': { | ||
'type': 'string', | ||
'allowed': [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here (source) |
||
'x86_64', | ||
'i686', | ||
], | ||
}, | ||
'devices': { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please take a good look at the devices schema, that is the one I struggled with since I am not familiar with the markup. Might be not 100% correct |
||
'type': 'dict', | ||
'schema': { | ||
'type': 'dict', | ||
'keyschema': { | ||
'type': 'string', | ||
}, | ||
}, | ||
}, | ||
'profiles': { | ||
'type': 'list', | ||
'schema': { | ||
'type': 'string' | ||
} | ||
}, | ||
'force_stop': { | ||
'type': 'boolean', | ||
}, | ||
} | ||
} | ||
}, | ||
} | ||
|
||
dependency_command_nullable_schema = { | ||
'dependency': { | ||
'type': 'dict', | ||
|
@@ -863,6 +942,8 @@ def validate(c): | |
elif c['driver']['name'] == 'vagrant': | ||
util.merge_dicts(schema, driver_vagrant_provider_section_schema) | ||
util.merge_dicts(schema, platforms_vagrant_schema) | ||
elif c['driver']['name'] == 'lxd': | ||
util.merge_dicts(schema, platforms_lxd_schema) | ||
else: | ||
util.merge_dicts(schema, platforms_base_schema) | ||
|
||
|
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.
Since you have implemented this API for molecule.yml we need to validate the schema. Can you update the v2 schema similar to what we did with dockder and vagrant.
https://github.com/metacloud/molecule/blob/master/molecule/model/schema_v2.py#L596
https://github.com/metacloud/molecule/blob/master/molecule/model/schema_v2.py#L862
And we will need to update tests with working and failing tests:
https://github.com/metacloud/molecule/blob/master/test/unit/model/v2/test_platforms_section.py