Update YamlDotNet to 8.1.2 (#504)
This commit is contained in:
@@ -37,7 +37,7 @@
|
|||||||
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.10" />
|
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.10" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" Condition="'$(TargetFramework)' != 'netstandard2.0' and '$(TargetFramework)' != 'netcoreapp2.1'" />
|
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" Condition="'$(TargetFramework)' != 'netstandard2.0' and '$(TargetFramework)' != 'netcoreapp2.1'" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'" />
|
||||||
<PackageReference Include="YamlDotNet" Version="6.0.0" />
|
<PackageReference Include="YamlDotNet" Version="8.1.2" />
|
||||||
<PackageReference Include="System.Buffers" Version="4.5.1" Condition="'$(TargetFramework)' != 'netcoreapp2.1'" />
|
<PackageReference Include="System.Buffers" Version="4.5.1" Condition="'$(TargetFramework)' != 'netcoreapp2.1'" />
|
||||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ namespace k8s
|
|||||||
.WithTypeConverter(new IntOrStringYamlConverter())
|
.WithTypeConverter(new IntOrStringYamlConverter())
|
||||||
.WithTypeConverter(new ByteArrayStringYamlConverter())
|
.WithTypeConverter(new ByteArrayStringYamlConverter())
|
||||||
.WithEventEmitter(e => new StringQuotingEmitter(e))
|
.WithEventEmitter(e => new StringQuotingEmitter(e))
|
||||||
|
.ConfigureDefaultValuesHandling(DefaultValuesHandling.OmitNull)
|
||||||
.BuildValueSerializer();
|
.BuildValueSerializer();
|
||||||
emitter.Emit(new StreamStart());
|
emitter.Emit(new StreamStart());
|
||||||
emitter.Emit(new DocumentStart());
|
emitter.Emit(new DocumentStart());
|
||||||
|
|||||||
@@ -114,10 +114,10 @@ metadata:
|
|||||||
var pod = new V1Pod() { ApiVersion = "v1", Kind = "Pod", Metadata = new V1ObjectMeta() { Name = "foo" } };
|
var pod = new V1Pod() { ApiVersion = "v1", Kind = "Pod", Metadata = new V1ObjectMeta() { Name = "foo" } };
|
||||||
|
|
||||||
var yaml = Yaml.SaveToString(pod);
|
var yaml = Yaml.SaveToString(pod);
|
||||||
Assert.True(ToLines(@"apiVersion: v1
|
Assert.Equal(ToLines(@"apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: foo").SequenceEqual(ToLines(yaml)));
|
name: foo"), ToLines(yaml));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -131,11 +131,11 @@ metadata:
|
|||||||
};
|
};
|
||||||
|
|
||||||
var yaml = Yaml.SaveToString(pod);
|
var yaml = Yaml.SaveToString(pod);
|
||||||
Assert.True(ToLines(@"apiVersion: v1
|
Assert.Equal(ToLines(@"apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: foo
|
name: foo
|
||||||
namespace: bar").SequenceEqual(ToLines(yaml)));
|
namespace: bar"), ToLines(yaml));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -170,7 +170,7 @@ metadata:
|
|||||||
};
|
};
|
||||||
|
|
||||||
var yaml = Yaml.SaveToString(pod);
|
var yaml = Yaml.SaveToString(pod);
|
||||||
Assert.True(ToLines(@"apiVersion: v1
|
Assert.Equal(ToLines(@"apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: foo
|
name: foo
|
||||||
@@ -184,7 +184,7 @@ spec:
|
|||||||
readOnly: true
|
readOnly: true
|
||||||
- mountPath: /vm2
|
- mountPath: /vm2
|
||||||
name: vm2
|
name: vm2
|
||||||
readOnly: false").SequenceEqual(ToLines(yaml)));
|
readOnly: false"), ToLines(yaml));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IEnumerable<string> ToLines(string s)
|
private static IEnumerable<string> ToLines(string s)
|
||||||
@@ -289,7 +289,7 @@ spec:
|
|||||||
};
|
};
|
||||||
|
|
||||||
var output = Yaml.SaveToString<V1Service>(obj);
|
var output = Yaml.SaveToString<V1Service>(obj);
|
||||||
Assert.True(ToLines(output).SequenceEqual(ToLines(content)));
|
Assert.Equal(ToLines(output), ToLines(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
Reference in New Issue
Block a user