fix: yaml ByteArrayStringYamlConverter output new lines (#1651)
* fix: yaml byte[] output * chore: fix styling * chore: fix logic for single line values and add test
This commit is contained in:
@@ -817,6 +817,30 @@ data:
|
||||
Assert.Equal("Mzk1MjgkdmRnN0pi", Encoding.UTF8.GetString(result.Data["password"]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WriteSecret()
|
||||
{
|
||||
var kManifest = """
|
||||
apiVersion: v1
|
||||
data:
|
||||
username: bXktYXBw
|
||||
tls2.crt: |
|
||||
-----BEGIN CERTIFICATE-----
|
||||
FAKE CERT
|
||||
FAKE CERT
|
||||
FAKE CERT
|
||||
-----END CERTIFICATE-----
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: test-secret
|
||||
""";
|
||||
|
||||
var result = KubernetesYaml.Deserialize<V1Secret>(kManifest, true);
|
||||
var yaml = KubernetesYaml.Serialize(result);
|
||||
|
||||
Assert.Equal(kManifest, yaml);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DeserializeWithJsonPropertyName()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user