Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(*) fix builtin gateway when adding to insights (#2980)
* fix(*) fix builtin gateway when adding to insights As according to our validators (https://github.com/kumahq/kuma/blob/c89ac43e1d46a16ad37f8898dbd932cda4b034dd/pkg/core/resources/apis/mesh/dataplane_validator.go#L34-L63) both gateways (delegated and builtin) cannot contain inbounds I added builtin gateway to skip trying to add its inbounds to the dataplane list of insight resources. I also refactored this parts of code to use protobuf's builtin associate `Get[...]` functions which handles nils better (i.e. in `dpOverview.Spec.GetDataplane().GetNetworking()` if `dpOverview.Spec.Dataplane` will be `nil` it won't crash. Also removed nested if statement and used `continue` to skip to the next loop iteration instead of using `else` branch. Signed-off-by: Bart Smykla <bartek@smykla.com>
- Loading branch information