allow container to be null/empty (#266)

This commit is contained in:
eric sciple
2020-01-12 23:02:36 -05:00
committed by GitHub
parent a9c58d7398
commit a727194742
2 changed files with 19 additions and 2 deletions

View File

@@ -154,6 +154,11 @@ namespace GitHub.DistributedTask.Pipelines.ObjectTemplating
if (value is StringToken containerLiteral) if (value is StringToken containerLiteral)
{ {
if (String.IsNullOrEmpty(containerLiteral.Value))
{
return null;
}
result.Image = containerLiteral.Value; result.Image = containerLiteral.Value;
} }
else else

View File

@@ -472,7 +472,7 @@
"matrix" "matrix"
], ],
"one-of": [ "one-of": [
"non-empty-string", "string",
"container-mapping" "container-mapping"
] ]
}, },
@@ -497,10 +497,22 @@
], ],
"mapping": { "mapping": {
"loose-key-type": "non-empty-string", "loose-key-type": "non-empty-string",
"loose-value-type": "container" "loose-value-type": "services-container"
} }
}, },
"services-container": {
"context": [
"github",
"strategy",
"matrix"
],
"one-of": [
"non-empty-string",
"container-mapping"
]
},
"container-env": { "container-env": {
"mapping": { "mapping": {
"loose-key-type": "non-empty-string", "loose-key-type": "non-empty-string",