diff --git a/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/YamlRenderedValueConverter.java b/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/YamlRenderedValueConverter.java index 0d72a7c432..59f5b737b4 100644 --- a/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/YamlRenderedValueConverter.java +++ b/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/YamlRenderedValueConverter.java @@ -39,7 +39,7 @@ public YamlRenderedValueConverter(Yaml yaml) { @Override public Object convertRenderedValue(String renderedValue) { - if (containsEL(renderedValue) || isYamlKeyword(renderedValue)) { + if (containsEL(renderedValue) || isYamlKeyword(renderedValue) || containsYamlParsingExceptions(renderedValue)) { return renderedValue; } if (containsNoExpandMarker(renderedValue)) { @@ -71,6 +71,11 @@ private static boolean isYamlKeyword(String renderedValue) { return YAML_KEYWORDS.contains(renderedValue.toLowerCase()); } + private static boolean containsYamlParsingExceptions(String renderedValue) { + return renderedValue != null && + renderedValue.startsWith("* "); // A markdown list: YAML will parse this as an alias and fail. + } + private static boolean containsNoExpandMarker(String renderedValue) { return renderedValue.startsWith("noexpand:"); } diff --git a/orca-pipelinetemplate/src/test/groovy/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/JinjaRendererSpec.groovy b/orca-pipelinetemplate/src/test/groovy/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/JinjaRendererSpec.groovy index de4dcc72cb..5246c9639c 100644 --- a/orca-pipelinetemplate/src/test/groovy/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/JinjaRendererSpec.groovy +++ b/orca-pipelinetemplate/src/test/groovy/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/JinjaRendererSpec.groovy @@ -87,6 +87,7 @@ class JinjaRendererSpec extends Specification { '${ #stage("First Wait")["status"].toString() == "SUCCESS" }' || String | '${ #stage("First Wait")["status"].toString() == "SUCCESS" }' '${ parameters.CONFIG_FOLDER ?: \'\' }' || String | '${ parameters.CONFIG_FOLDER ?: \'\' }' '' || String | null + '* markdown list' || String | '* markdown list' 'noexpand:{"t": "deployment"}' || String | '{"t": "deployment"}' }