You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a field in a struct can override its type with the marker +kubebuilder:validation:Type=<type>. I have a use case where I want to allow multiple types such as boolean and string. This could be achieved by defining the Parser's Schemata as:
And it's currently done in the types k8s.io/apimachinery/pkg/api/resource.Quantity and k8s.io/apimachinery/pkg/util/intstr.IntOrString. However this is hardcoded and very limiting.
What I propose is adding a new validation marker called types which works by defining +kubebuilder:validation:Types=<Type1>[;Type2[;Type3...]]
I'm aware of #461 but I don't think they are mutually exclusive and I'm pretty sure that I can implement this in a reasonable amount of time.
The text was updated successfully, but these errors were encountered:
I'm closing this issue as I don´t think this is actually feasible without making big changes in the schema validation. I don´t see a way to do this without changing fundamental aspects of it which I doubt the community would accept.
The schema validator skips a bunch of validations in the event of IntOrString so even if the schema is generated correctly the apiserver will not accept it anyway.
Currently a field in a struct can override its type with the marker
+kubebuilder:validation:Type=<type>
. I have a use case where I want to allow multiple types such asboolean
andstring
. This could be achieved by defining the Parser's Schemata as:And it's currently done in the types
k8s.io/apimachinery/pkg/api/resource.Quantity
andk8s.io/apimachinery/pkg/util/intstr.IntOrString
. However this is hardcoded and very limiting.What I propose is adding a new validation marker called types which works by defining
+kubebuilder:validation:Types=<Type1>[;Type2[;Type3...]]
I'm aware of #461 but I don't think they are mutually exclusive and I'm pretty sure that I can implement this in a reasonable amount of time.
The text was updated successfully, but these errors were encountered: