Skip to content
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

Merged
merged 6 commits into from
Aug 5, 2021

Conversation

lobkovilya
Copy link
Contributor

@lobkovilya lobkovilya commented Jul 29, 2021

Summary

We were missing ZoneIngressInsight manager that sets ownership when creating resources.

Full changelog

  • fix bug with a logger that had "odd number of arguments"
  • fix bug with kumactl delete zone <zone-name
  • add e2e tests for ownership

Issues resolved

N/A

Documentation

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

Backwards compatibility

  • Add backport-to-stable label if the code is backwards compatible. Otherwise, list breaking changes.

Signed-off-by: Ilya Lobkov <lobkovilya@yandex.ru>
Copy link
Contributor

@jpeach jpeach left a 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.

app/kuma-dp/cmd/run.go Outdated Show resolved Hide resolved
pkg/core/bootstrap/bootstrap.go Outdated Show resolved Hide resolved
@@ -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 {
Copy link
Contributor

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?

Expect(actual.Spec.Subscriptions[2].Id).To(Equal("9"))
})

It("should cleanup subscriptions if disabled", func() {
Copy link
Contributor

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?

Copy link
Contributor Author

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

lobkovilya and others added 4 commits August 3, 2021 19:29
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>
@lobkovilya lobkovilya force-pushed the fix/zone-ingress-insight-owner branch from 97f0c67 to 0cfa450 Compare August 4, 2021 12:01
@codecov-commenter
Copy link

Codecov Report

Merging #2456 (0cfa450) into master (b1f6f20) will decrease coverage by 0.00%.
The diff coverage is 41.91%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
app/kuma-dp/cmd/run.go 71.14% <0.00%> (ø)
test/e2e/ownership/multizone_universal.go 0.00% <0.00%> (ø)
...zoneingressinsight/zone_ingress_insight_manager.go 59.25% <59.25%> (ø)
app/kuma-dp/pkg/dataplane/metrics/merge.go 85.62% <100.00%> (-0.77%) ⬇️
pkg/core/bootstrap/bootstrap.go 63.22% <100.00%> (+0.61%) ⬆️
pkg/core/managers/apis/zone/zone_manager.go 75.00% <100.00%> (+2.27%) ⬆️
pkg/core/resources/manager/cache.go 81.81% <0.00%> (ø)
...kg/core/resources/apis/mesh/generated_resources.go 80.18% <0.00%> (+0.41%) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 49e24fe...0cfa450. Read the comment docs.

Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>

# Conflicts:
#	pkg/core/bootstrap/bootstrap.go
@lobkovilya lobkovilya merged commit cc10d19 into master Aug 5, 2021
@lobkovilya lobkovilya deleted the fix/zone-ingress-insight-owner branch August 5, 2021 07:58
mergify bot pushed a commit that referenced this pull request Aug 5, 2021
(cherry picked from commit cc10d19)

# Conflicts:
#	app/kuma-dp/cmd/run.go
#	pkg/core/bootstrap/bootstrap.go
jpeach pushed a commit that referenced this pull request Aug 11, 2021
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
(cherry picked from commit cc10d19)
jpeach pushed a commit that referenced this pull request Aug 11, 2021
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
(cherry picked from commit cc10d19)

Co-authored-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants