-
-
Couldn't load subscription status.
- Fork 82
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When converting the ResourceQuantity class, the transpiler produces this CRD output (in this case, for resource limits):
limits:
additionalProperties:
properties:
format:
enum:
- DecimalExponent
- BinarySI
- DecimalSI
nullable: false
type: string
value:
nullable: false
type: string
type: object
nullable: false
type: objectMeaning it would expect the custom resource YAML to look something like:
resources:
limits:
cpu:
enum: BinarySI
value: abcdefgHowever, this doesn't agree with the way Kubernetes expects resource quantities, like 512Mi. The way CRD YAML should look is:
limits:
type: object
additionalProperties:
type: stringThe K8s SDK handles converting the value.
I've already have a fix + test for this. Wasn't sure if an issue should be created first or not. 😄
To reproduce
- Create a custom resource spec that uses the
ResourceQuantityclass (likeV1ResourceRequirements) - Generate the CRD and look at the invalid output
Expected behavior
It generates a valid CRD.
Screenshots
No response
Additional Context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working