Browse Source

Ignore yaml nodes without main node

migrate-pregen
nicolas.dorier 7 years ago
parent
commit
b63f3f7b1f
  1. 3
      docker-compose-generator/src/DockerComposeDefinition.cs

3
docker-compose-generator/src/DockerComposeDefinition.cs

@ -80,8 +80,9 @@ namespace DockerGenerator
.GroupBy(s => s.Key.ToString(), s => s.Value)
.Select(group =>
(GroupName: group.Key,
MainNode: group.OfType<YamlMappingNode>().Single(n => n.Children.ContainsKey("image")),
MainNode: group.OfType<YamlMappingNode>().SingleOrDefault(n => n.Children.ContainsKey("image")),
MergedNodes: group.OfType<YamlMappingNode>().Where(n => !n.Children.ContainsKey("image"))))
.Where(_ => _.MainNode != null)
.Select(_ =>
{
foreach(var node in _.MergedNodes)

Loading…
Cancel
Save