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

[bug]: range (minimum/maximum) attributes generate a yaml value in current culture. #581

Closed
SGStino opened this issue Aug 3, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@SGStino
Copy link

SGStino commented Aug 3, 2023

Describe the bug

When using the range attributes, the generated CRD always contain decimal values, but generated in the culture of the OS.
Which is invalid, as yaml only accepts a decimal point, and some cultures use decimal commas.

To reproduce

 [RangeMinimum(Minimum = byte.MinValue), RangeMaximum(Maximum = byte.MaxValue)]
 public int MyProperty {get; set;}

generates

myProperty: 
    exclusiveMaximum: false
    exclusiveMinimum: false
    format: int32
    maximum: 255,0
    minimum: 0,0
    type: integer

in culture nl-BE

Expected behavior

I'd expect it to generate Invariant Culture numbers:

myProperty: 
    exclusiveMaximum: false
    exclusiveMinimum: false
    format: int32
    maximum: 255.0
    minimum: 0.0
    type: integer

and for integers i'd even expect:

myProperty: 
    exclusiveMaximum: false
    exclusiveMinimum: false
    format: int32
    maximum: 255
    minimum: 0
    type: integer

Screenshots

No response

Additional Context

No response

@SGStino SGStino added the bug Something isn't working label Aug 3, 2023
@SGStino
Copy link
Author

SGStino commented Aug 3, 2023

A workaround could be:

    <InvariantGlobalization>true</InvariantGlobalization>

This could maybe be added to the KubeObs.Template?

@SGStino
Copy link
Author

SGStino commented Mar 1, 2024

in version 8, the KubeObs.Cli has the same issue. The workaround is no help there.

@SGStino
Copy link
Author

SGStino commented Mar 29, 2024

the kubernetes client got patched, this probably means that this issue will resolve itself as soon as that version is used.

@SGStino SGStino closed this as completed Mar 29, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant