One-of constraint applied to task config
This commit is contained in:
@@ -194,6 +194,7 @@ public class PipelineYmlSchema implements YamlSchema {
|
||||
addProp(task, "outputs", f.yseq(t_output));
|
||||
addProp(task, "run", t_command).isRequired(true);
|
||||
addProp(task, "params", t_string_params);
|
||||
task.requireOneOf("image_resource", "image");
|
||||
|
||||
YBeanType getStep = f.ybean("GetStep");
|
||||
addProp(getStep, "get", t_resource_name);
|
||||
|
||||
@@ -1675,8 +1675,10 @@ public class ConcourseEditorTest {
|
||||
"params: the-params\n"
|
||||
);
|
||||
editor.assertProblems(
|
||||
"image_resource|Only one of [image_resource, image] should be defined",
|
||||
"name|Unknown property",
|
||||
"bogus-source-prop|Unknown property",
|
||||
"image|Only one of [image_resource, image] should be defined",
|
||||
"path: path/to/input|'name' is required",
|
||||
"path: path/to/output|'name' is required",
|
||||
"the-params|Expecting a 'Map'"
|
||||
@@ -1768,8 +1770,10 @@ public class ConcourseEditorTest {
|
||||
" params: the-params"
|
||||
);
|
||||
editor.assertProblems(
|
||||
"image_resource|Only one of [image_resource, image] should be defined",
|
||||
"name|Unknown property",
|
||||
"bogus-source-prop|Unknown property",
|
||||
"image|Only one of [image_resource, image] should be defined",
|
||||
"path: path/to/input|'name' is required",
|
||||
"path: path/to/output|'name' is required",
|
||||
"the-params|Expecting a 'Map'"
|
||||
|
||||
Reference in New Issue
Block a user