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
Per kubernetes-sigs/controller-tools#342 our tooling does not support automated validation generation for arrays of standard types where we wish to apply validation rules to the items within the array. For example, if you wish to enforce that every string item in the protocols array is one of http, https, udp, or tcp, you cannot.
Proposed Solution
Absent functionality in controller-tools (which is unlikely to arrive any time soon), the prescribed solution is to create a dedicated alias type. You can write something like:
//+kubebuilder:validation:Enum=http;https;grpc;grpcs;tcp;tls;udp
type KongPluginProtocol string
Protocols []KongPluginProtocol `json:"protocols,omitempty"`
Is there an existing issue for this?
Problem Statement
Follow-up from #1757 (comment)
Per kubernetes-sigs/controller-tools#342 our tooling does not support automated validation generation for arrays of standard types where we wish to apply validation rules to the items within the array. For example, if you wish to enforce that every string item in the
protocols
array is one ofhttp
,https
,udp
, ortcp
, you cannot.Proposed Solution
Absent functionality in controller-tools (which is unlikely to arrive any time soon), the prescribed solution is to create a dedicated alias type. You can write something like:
where we've currently tried
and Kubebuilder will build the correct validation rule.
Additional information
No response
Acceptance Criteria
The text was updated successfully, but these errors were encountered: