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

Refactor event handling and remove service reconciler #360

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

solmonk
Copy link
Contributor

@solmonk solmonk commented Aug 27, 2023

What type of PR is this?

refactoring/enhancement

Which issue does this PR fix:

#359

What does this PR do / Why do we need it:

We have multiple reconcilers that do the same thing which causes bug #359, and it is really hard to understand what is going on event handler. I did a refactoring to help clarify which resource events are mapped to which other resources.

  • (Almost) deleted service reconciler, now it only removes finalizer for keeping compatibility. Its main purpose was watching endpoint event, so now it is watched on serviceexport / route reconcilers instead.
  • Removed and unified event handlers. Now service event handler covers all service related events such as policy and endpoints.
  • Added mapper.go under event handler package dedicated to resource mapping using k8s client api calls
  • Added a few unit tests on event handler

If an issue # is not available please add repro steps and logs from aws-gateway-controller showing the issue:

Testing done on this change:
e2etest, also manually tested #359 case by updating existing service endpoints.

Automation added to e2e:

Will this PR introduce any new dependencies?:

Will this break upgrades or downgrades. Has updating a running cluster been tested?:

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@coveralls
Copy link

coveralls commented Aug 27, 2023

Pull Request Test Coverage Report for Build 5993051159

  • 131 of 183 (71.58%) changed or added relevant lines in 5 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+1.7%) to 39.191%

Changes Missing Coverage Covered Lines Changed/Added Lines %
controllers/serviceexport_controller.go 0 3 0.0%
controllers/eventhandlers/serviceimport.go 14 18 77.78%
controllers/eventhandlers/service.go 34 41 82.93%
controllers/route_controller.go 0 8 0.0%
controllers/eventhandlers/mapper.go 83 113 73.45%
Files with Coverage Reduction New Missed Lines %
controllers/service_controller.go 1 0.0%
controllers/eventhandlers/service.go 2 81.25%
Totals Coverage Status
Change from base Build 5992865652: 1.7%
Covered Lines: 4003
Relevant Lines: 10214

💛 - Coveralls

2 similar comments
@coveralls
Copy link

Pull Request Test Coverage Report for Build 5993051159

  • 131 of 183 (71.58%) changed or added relevant lines in 5 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+1.7%) to 39.191%

Changes Missing Coverage Covered Lines Changed/Added Lines %
controllers/serviceexport_controller.go 0 3 0.0%
controllers/eventhandlers/serviceimport.go 14 18 77.78%
controllers/eventhandlers/service.go 34 41 82.93%
controllers/route_controller.go 0 8 0.0%
controllers/eventhandlers/mapper.go 83 113 73.45%
Files with Coverage Reduction New Missed Lines %
controllers/service_controller.go 1 0.0%
controllers/eventhandlers/service.go 2 81.25%
Totals Coverage Status
Change from base Build 5992865652: 1.7%
Covered Lines: 4003
Relevant Lines: 10214

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5993051159

  • 131 of 183 (71.58%) changed or added relevant lines in 5 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+1.7%) to 39.191%

Changes Missing Coverage Covered Lines Changed/Added Lines %
controllers/serviceexport_controller.go 0 3 0.0%
controllers/eventhandlers/serviceimport.go 14 18 77.78%
controllers/eventhandlers/service.go 34 41 82.93%
controllers/route_controller.go 0 8 0.0%
controllers/eventhandlers/mapper.go 83 113 73.45%
Files with Coverage Reduction New Missed Lines %
controllers/service_controller.go 1 0.0%
controllers/eventhandlers/service.go 2 81.25%
Totals Coverage Status
Change from base Build 5992865652: 1.7%
Covered Lines: 4003
Relevant Lines: 10214

💛 - Coveralls

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.

3 participants