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

Remove assumption that custom resources have a spec field #35

Open
khaled opened this issue Sep 26, 2023 · 1 comment
Open

Remove assumption that custom resources have a spec field #35

khaled opened this issue Sep 26, 2023 · 1 comment

Comments

@khaled
Copy link

khaled commented Sep 26, 2023

kubernetes.api.resources options generated as a result of specifying kubernetes.customTypes config values currently assume that the custom types have a spec field.

Though it may be convention, AFAIK it is not a requirement that CRD's have such a field. Here's an example in the wild. And currently there is no clean way to specify different toplevel options such as configuration from the provided example.

FWIW I was able to add additional toplevel options using kubernetes.api.defaults, though this is verbose and probably not its intended use, and as such I consider it an ugly hack :-)

More importantly, AFAICT there is no way to prevent a spec value of {} from showing up in the output, which is invalid if the CRD doesn't have spec in its schema.

@khaled khaled changed the title Should not assume that custom resources have a spec field Remove assumption that custom resources have a spec field Sep 26, 2023
@hall
Copy link
Owner

hall commented Sep 26, 2023

Looks and sounds right to me; configMap and secret objects don't have a spec field so it's not unreasonable that CRs might not either.

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

No branches or pull requests

2 participants