Reconcile: 'image' attribute in a task step should refers to a resource name

This commit is contained in:
Kris De Volder
2017-04-03 11:16:51 -07:00
parent 6191c23b23
commit 3e73814aa9
2 changed files with 6 additions and 3 deletions

View File

@@ -268,7 +268,7 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(taskStep, "config", task);
addProp(taskStep, "privileged", t_boolean);
addProp(taskStep, "params", t_params);
addProp(taskStep, "image", t_ne_string);
addProp(taskStep, "image", t_resource_name);
addProp(taskStep, "input_mapping", f.ymap(t_ne_string, t_resource_name));
addProp(taskStep, "output_mapping", t_string_params);
taskStep.requireOneOf("config", "file");

View File

@@ -487,6 +487,7 @@ public class ConcourseEditorTest {
" - get: sts4\n" +
" - get: bogus-get\n" +
" - task: do-stuff\n" +
" image: bogus-image\n" +
" file: some-file.yml\n" +
" input_mapping:\n" +
" task-input: bogus-input\n" +
@@ -495,12 +496,14 @@ public class ConcourseEditorTest {
);
editor.assertProblems(
"bogus-get|resource does not exist",
"bogus-image|resource does not exist",
"bogus-input|resource does not exist",
"bogus-put|resource does not exist"
);
editor.assertProblems(
"bogus-get|[sts4]",
"bogus-image|[sts4]",
"bogus-input|[sts4]",
"bogus-put|[sts4]"
);
@@ -2568,7 +2571,7 @@ public class ConcourseEditorTest {
@Test public void resourceInEmbeddedTaskConfigDeprecated() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
"- name: docker-image\n" +
"- name: my-docker-image\n" +
" type: docker-image\n" +
" source:\n" +
" username: {{docker_hub_username}}\n" +
@@ -2578,7 +2581,7 @@ public class ConcourseEditorTest {
"- name: build-commons-update-site\n" +
" plan:\n" +
" - task: hello-world\n" +
" image: docker-image\n" +
" image: my-docker-image\n" +
" config:\n" +
" image: blah\n" +
" image_resource:\n" +