-
Enhancement
-
Resolution: Done
-
Major
-
1.35.0.Final
-
None
-
False
-
None
-
False
-
---
-
---
-
-
-
2023 Week 12-14 (from Mar 20), 2023 Week 15-17 (from Apr 10)
What would you like to be added:
Kubernetes Kubebuilder code generator is not able to handle union tag which handles the oneOf definition that allows us to define which types a struct accepts two types, example, string and boolean.
More information on kubernetes-sigs/controller-tools#298
One option to overcome this problem is defining the affect struct as schemaless and delegate the workflow validation to the admission webhook.
E..g:
// +kubebuilder:validation:Schemaless // +kubebuilder:pruning:PreserveUnknownFields Object *CustomObj `json:"object,omitempty"`
{}This way, this field can be defined as Schemaless and will accept any value.
Why is this needed:
To be able to smoothly integrate the sdk with Kubernetes.