-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(*) fix builtin gateway when adding to insights #2980
fix(*) fix builtin gateway when adding to insights #2980
Conversation
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>
Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
Codecov Report
@@ Coverage Diff @@
## master #2980 +/- ##
==========================================
+ Coverage 52.33% 52.38% +0.05%
==========================================
Files 912 912
Lines 52583 52581 -2
==========================================
+ Hits 27517 27546 +29
+ Misses 22876 22837 -39
- Partials 2190 2198 +8
Continue to review full report at Codecov.
|
Summary
As according to our validators
kuma/pkg/core/resources/apis/mesh/dataplane_validator.go
Lines 34 to 63 in c89ac43
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()
ifdpOverview.Spec.Dataplane
will benil
it won't crash.Also removed nested if statement and used
continue
to skipto the next loop iteration instead of using
else
branch.Full changelog
n/a
Issues resolved
n/a
Documentation
n/a
Testing
Backwards compatibility
backport-to-stable
label if the code is backwards compatible. Otherwise, list breaking changes.