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

Support +enum tags in k8s APIs #3861

Closed
alculquicondor opened this issue Apr 10, 2024 · 4 comments
Closed

Support +enum tags in k8s APIs #3861

alculquicondor opened this issue Apr 10, 2024 · 4 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@alculquicondor
Copy link
Contributor

What do you want to happen?

Kubernetes APIs include an enum tag such as this one:

https://github.com/kubernetes/kubernetes/blob/be4b7176dc131ea842cab6882cd4a06dbfeed12a/staging/src/k8s.io/api/core/v1/types.go#L3506-L3507

which translates to the following OpenAPIv3:

          "effect": {
            "description": "Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSc>
            "type": "string",
            "default": "",
            "enum": [
              "NoExecute",
              "NoSchedule",
              "PreferNoSchedule"
            ]

However, kubebuilder doesn't recognize them when using these types in another project.

Example in Kueue, for the code in https://github.com/kubernetes-sigs/kueue/blob/34bfbe0f359b8439b737f07c3f3e5da92c7d0d67/apis/kueue/v1beta1/resourceflavor_types.go#L68
The rendered CRD lacks the enum information:
https://github.com/kubernetes-sigs/kueue/blob/34bfbe0f359b8439b737f07c3f3e5da92c7d0d67/config/components/crd/bases/kueue.x-k8s.io_resourceflavors.yaml#L87-L89

Extra Labels

No response

@alculquicondor alculquicondor added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 10, 2024
@camilamacedo86
Copy link
Member

HI @alculquicondor

This one should be raised against controller-tools. See: https://github.com/kubernetes-sigs/controller-tools

Can you please transfer this issue to their repo?

Thank you for your attention and time.

@tenzen-y
Copy link
Member

I transferred this issue to kubernetes-sigs/controller-tools#933 on behalf of the kueue maintainers.

@camilamacedo86
Copy link
Member

camilamacedo86 commented Apr 26, 2024

HI @tenzen-y

The CRDs are generated by controller-tools not Kubebuilder.
I do not know who ware kueue maintainers
What is kueue

@tenzen-y
Copy link
Member

HI @tenzen-y

The CRDs are generated by controller-tools not Kubebuilder. I do not know who ware kueue maintainers What is kueue

If you are confused, sorry for that. I just wanted to say that I transferred this issue instead of Aldo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants