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
KongIngress currently includes go-kong Route, Service, and Upstream structs within its struct. Kubebuilder-generated CRDs include all fields in these child structs, including those that you cannot actually change (and often probably shouldn't try to change) with a KongIngress. The KongIngress CRD should only expose fields that you can actually change.
KongIngress further uses internal hidden validation logic. CRD-level validation is better, since it can reject resources at creation time rather than discarding them and/or emitting warnings during controller configuration build.
Though KongIngress includes go-kong Route and Service types, it limits the fields you can actually use through this validation. The Upstream, by comparison, is copied more or less as-is into the struct passed to Kong.
Proposed Solution
Implement new dedicated types for the proxy (service), upstream, and route fields within KongIngress.
Update the configuration builder to populate go-kong structs from the new type structs.
Where possible, move validation from the KongIngress override functions into standard CRD OAS validation.
Evaluate which fields the KongIngress Upstream should actually expose (e.g. probably do not expose created/updated timestamps) for the new type. Excluding some is breaking, since we are removing functionality that was previously available, even though fields we remove should have no obvious use.
Additional information
No response
Acceptance Criteria
KongIngress child types expose all fields that you can currently set on Routes and Services.
The KongIngress Upstream type exposes fields we expect users will need to set on Upstreams (generally, anything that provides functionality and is not pure metadata).
The KongIngress CRD applies validation criteria at least equivalent to the internal configuration build validation for routes and services.
The KongIngress CRD includes validation criteria from the original CRD, with the exception of redundant type assertions (e.g. a struct field whose type is a Go string does not need an explicit type: string validation rule.
Is there an existing issue for this?
Problem Statement
Post #1757 follow up for #1749
KongIngress currently includes go-kong Route, Service, and Upstream structs within its struct. Kubebuilder-generated CRDs include all fields in these child structs, including those that you cannot actually change (and often probably shouldn't try to change) with a KongIngress. The KongIngress CRD should only expose fields that you can actually change.
KongIngress further uses internal hidden validation logic. CRD-level validation is better, since it can reject resources at creation time rather than discarding them and/or emitting warnings during controller configuration build.
Though KongIngress includes go-kong Route and Service types, it limits the fields you can actually use through this validation. The Upstream, by comparison, is copied more or less as-is into the struct passed to Kong.
Proposed Solution
proxy
(service),upstream
, androute
fields within KongIngress.Additional information
No response
Acceptance Criteria
string
does not need an explicittype: string
validation rule.The text was updated successfully, but these errors were encountered: