-
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(kuma-cp) add owner when create ZoneIngressInsight #2456
Conversation
Signed-off-by: Ilya Lobkov <lobkovilya@yandex.ru>
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.
Looks pretty good to me. Had a few small style nits.
@@ -23,7 +23,8 @@ type zoneManager struct { | |||
} | |||
|
|||
func (z *zoneManager) Delete(ctx context.Context, r model.Resource, opts ...core_store.DeleteOptionsFunc) error { | |||
if err := z.validator.ValidateDelete(ctx, r.GetMeta().GetName()); err != nil { | |||
options := core_store.NewDeleteOptions(opts...) | |||
if err := z.validator.ValidateDelete(ctx, options.Name); err != nil { |
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.
Nit: seems like it would be cleaner to pass the delete options down to VallidateDelete
. If you agree, file a follow up issue?
pkg/core/managers/apis/zoneingressinsight/zone_ingress_insight_manager.go
Show resolved
Hide resolved
pkg/core/managers/apis/zoneingressinsight/zone_ingress_insight_manager_test.go
Show resolved
Hide resolved
pkg/core/managers/apis/zoneingressinsight/zone_ingress_insight_manager.go
Outdated
Show resolved
Hide resolved
Expect(actual.Spec.Subscriptions[2].Id).To(Equal("9")) | ||
}) | ||
|
||
It("should cleanup subscriptions if disabled", func() { |
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.
What if the store already has some insights in it, then you restart the manager with metrics disabled. Should they be deleted? Is it worth making a separate test for that?
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.
No, they will be deleted only when Create/Update method will be called. So I'm not sure if this has to be tested
Co-authored-by: James Peach <james.peach@konghq.com>
Signed-off-by: Ilya Lobkov <lobkovilya@yandex.ru>
Signed-off-by: Ilya Lobkov <lobkovilya@yandex.ru> # Conflicts: # pkg/api-server/definitions/all.go
Signed-off-by: Ilya Lobkov <lobkovilya@yandex.ru>
97f0c67
to
0cfa450
Compare
Codecov Report
@@ Coverage Diff @@
## master #2456 +/- ##
==========================================
- Coverage 52.37% 52.36% -0.01%
==========================================
Files 866 868 +2
Lines 48249 48332 +83
==========================================
+ Hits 25270 25311 +41
- Misses 20939 20980 +41
- Partials 2040 2041 +1
Continue to review full report at Codecov.
|
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com> # Conflicts: # pkg/core/bootstrap/bootstrap.go
(cherry picked from commit cc10d19) # Conflicts: # app/kuma-dp/cmd/run.go # pkg/core/bootstrap/bootstrap.go
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com> (cherry picked from commit cc10d19)
Summary
We were missing ZoneIngressInsight manager that sets ownership when creating resources.
Full changelog
kumactl delete zone <zone-name
Issues resolved
N/A
Documentation
Testing
Backwards compatibility
backport-to-stable
label if the code is backwards compatible. Otherwise, list breaking changes.