Support for Free-Form Objects in crd generator
See original GitHub issueIs your enhancement related to a problem? Please describe
I’m trying to create a spec property as a free-form object from my POJO but it seems that it’s not possible.
I wanted to add a map/object
property that accepts any kind of value (string, int, objects…).
I’ve tried in these ways
Map<String, ?> config;
Map<String, Object> config;
Both generate this schema:
config:
additionalProperties:
type: object
type: object
My goal is to generate instead
config:
additionalProperties: {}
type: object
or
config:
additionalProperties: true
type: object
Describe the solution you’d like
Be able to generate a spec like:
config:
additionalProperties: true
type: object
Describe alternatives you’ve considered
No response
Additional context
Using latest version
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
GSOC 17: Making CustomResources in Kubernetes more ...
The custom resource instance is free-form JSON (possibly validated though with CRD validation), so we need to know the JSON paths to spec...
Read more >Generating CRDs - The Kubebuilder Book
Generating CRDs. Kubebuilder uses a tool called controller-gen to generate utility code and Kubernetes object YAML, like CustomResourceDefinitions.
Read more >Freeform board tasks - ServiceNow Docs
How search works: Punctuation and capital letters are ignored. Special characters like underscores (_) are removed.
Read more >deepcopy-gen generates invalid code for interface{} #138
Declaring a map[string]interface{} member in a struct handled by deepcopy-gen generates invalid code. It seems there could be two options ...
Read more >Creating an object from a custom resource definition
A custom resource definition (CRD) file defines your own object kinds and lets the API Server handle the entire lifecycle.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@andreaTP I’ve sent out a fix, please review https://github.com/fabric8io/kubernetes-client/pull/4642
It looks like this is a valid workaround
the generated schema
this allows me to pass nested objects with any kind of values However the k8s data type validation is basically disabled so I’d retain this feature request since it would be the right way to do it