-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[crd-gen] Enum fields written in generated crd yaml #4225
Comments
I think that the problem is here: kubernetes-client/crd-generator/api/src/main/java/io/fabric8/crd/generator/AbstractJsonSchema.java Line 592 in b90ee77
def.getProperties() return both fields and values...We are need of something like getValues(). |
Can reproduce the bug and is valid indeed. |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
this issue is not stale, the underlying bug is still valid. |
ping to @iocanel on this. |
@andreaTP
generate this
I need this because I have field in CR file that has hyphens in it and I'm not able to use enums for that field because enums can't use hyphens, so I was looking for a work around. |
Sundrio does not treat enums differently. This means for sundrio enums are regular classes with |
This is only a partial solution, as it leaves space for other issues as demonstrated here. |
Describe the bug
When the crd-gen tool tries to generate schema properties from an enum, both values and fields are written in the generated crd yaml.
Fabric8 Kubernetes Client version
5.12.2
Steps to reproduce
Create an enum with values and at least a field and put it into Spec.
Example:
Exec
mvn clean compile
the generated file target/classes/META-INF/fabric8/mycrds.com.example-v1.yml will contain:
Expected behavior
A crd with just enum values and without enum fields:
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.22.3@latest
Environment
Windows
Fabric8 Kubernetes Client Logs
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: