Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KubernetesYaml.Serialize Globalization issue #1532

Closed
SGStino opened this issue Mar 1, 2024 · 0 comments · Fixed by #1541
Closed

KubernetesYaml.Serialize Globalization issue #1532

SGStino opened this issue Mar 1, 2024 · 0 comments · Fixed by #1541
Assignees

Comments

@SGStino
Copy link

SGStino commented Mar 1, 2024

Describe the bug
KubernetesYaml uses Culture dependant string formatting for floating point numbers.

Kubernetes C# SDK Client Version
13.0.11

Server Kubernetes Version
N/A

Dotnet Runtime Version
net8

To Reproduce

using k8s;
using System.Globalization;
CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-fr");
Console.WriteLine(KubernetesYaml.Serialize(new Dictionary<string, double>() { ["hello"] = 10.01 })); 
Console.WriteLine(KubernetesJson.Serialize(new Dictionary<string, double>() { ["hello"] = 10.01 }));
hello: 10,01
{"hello":10.01}

Expected behavior
Yaml shouldn't be culture dependant, a decimal 10.01 should always, in any culture, be outputted with a decimal point in yaml.

KubeConfig
N/A

Where do you run your app with Kubernetes SDK (please complete the following information):

  • OS: N/A
  • Environment: N/A
  • Cloud N/A

Additional context
This is the source of this issue: buehler/dotnet-operator-sdk#581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants