Add 'variables' to bosh schema

This commit is contained in:
Kris De Volder
2017-07-10 16:23:07 -07:00
parent ac13944830
commit f933ba6860
3 changed files with 39 additions and 0 deletions

View File

@@ -72,6 +72,10 @@ public class BoshDeploymentManifestSchema implements YamlSchema {
addProp(TOPLEVEL_TYPE, "instance_groups", f.yseq(t_instance_group)).isRequired(true);
addProp(TOPLEVEL_TYPE, "properties", t_params).isDeprecated("Deprecated in favor of job level properties and links");
YType t_variable = t_params; //TODO: https://www.pivotaltracker.com/story/show/148627441
addProp(TOPLEVEL_TYPE, "variables", f.yseq(t_variable));
}
@Override

View File

@@ -0,0 +1,20 @@
*Optional*. Describes variables.
Example:
variables:
- name: admin_password
type: password
- name: default_ca
type: certificate
options:
is_ca: true
common_name: some-ca
- name: director_ssl
type: certificate
options:
ca: default_ca
common_name: cc.cf.internal
alternative_names: [cc.cf.internal]
See (CLI Variable Interpolation)[https://bosh.io/docs/cli-int.html] for more details about variables.

View File

@@ -75,6 +75,20 @@ public class BoshEditorTest {
" persistent_disk_type: medium\n" +
" networks:\n" +
" - name: default\n" +
"variables:\n" +
"- name: admin_password\n" +
" type: password\n" +
"- name: default_ca\n" +
" type: certificate\n" +
" options:\n" +
" is_ca: true\n" +
" common_name: some-ca\n" +
"- name: director_ssl\n" +
" type: certificate\n" +
" options:\n" +
" ca: default_ca\n" +
" common_name: cc.cf.internal\n" +
" alternative_names: [cc.cf.internal]\n" +
"properties:\n" +
" a-property: the-value\n" +
"blah: hoooo\n"
@@ -91,6 +105,7 @@ public class BoshEditorTest {
editor.assertHoverContains("update", "This specifies instance update properties");
editor.assertHoverContains("instance_groups", "Specifies the mapping between release [jobs](https://bosh.io/docs/terminology.html#job) and instance groups.");
editor.assertHoverContains("properties", 3, "Describes global properties. Deprecated");
editor.assertHoverContains("variables", "Describes variables");
}