Add stemcells property to schema

This commit is contained in:
Kris De Volder
2017-07-10 15:30:00 -07:00
parent bdea619fe5
commit 4fa7299585
3 changed files with 23 additions and 12 deletions

View File

@@ -60,8 +60,12 @@ public class BoshDeploymentManifestSchema implements YamlSchema {
YBeanType t_release = f.ybean("Release");
addProp(t_release, "name", t_ne_string).isRequired(true);
addProp(t_release, "version", t_version).isRequired(true);
addProp(TOPLEVEL_TYPE, "releases", f.yseq(t_release)).isRequired(true);
YType t_stemcell = t_params; //TODO: https://www.pivotaltracker.com/story/show/148627093
addProp(TOPLEVEL_TYPE, "stemcells", f.yseq(t_stemcell)).isRequired(true);
}
@Override

View File

@@ -0,0 +1,11 @@
*Required.* The name and version of each stemcell in the deployment.
Example:
stemcells:
- alias: default
os: ubuntu-trusty
version: 3147
- alias: default2
name: bosh-aws-xen-hvm-ubuntu-trusty-go_agent
version: 3149

View File

@@ -39,25 +39,20 @@ public class BoshEditorTest {
"releases:\n" +
"- name: redis\n" +
" version: 12\n" +
"stemcells:\n" +
"- alias: default\n" +
" os: ubuntu-trusty\n" +
" version: 3421.11\n" +
"blah: hoooo\n"
);
editor.assertProblems(
"blah|Unknown property"
);
}
@Test public void toplevelV2PropertyHovers() throws Exception {
Editor editor = harness.newEditor(
"name: some-name\n" +
"director_uuid: cf8dc1fc-9c42-4ffc-96f1-fbad983a6ce6\n" +
"releases:\n" +
"- name: redis\n" +
" version: 12\n" +
"blah: hoooo\n"
);
editor.assertHoverContains("name", "The name of the deployment");
editor.assertHoverContains("director_uuid", "This string must match the UUID of the currently targeted Director");
editor.assertHoverContains("releases", "The name and version of each release in the deployment");
editor.assertHoverContains("stemcells", "The name and version of each stemcell");
}
@Test public void toplevelV2PropertyCompletions() throws Exception {
@@ -67,7 +62,8 @@ public class BoshEditorTest {
editor.assertCompletions(
"director_uuid: <*>",
"name: <*>",
"releases:\n- <*>"
"releases:\n- <*>",
"stemcells:\n- <*>"
);
}