-
Notifications
You must be signed in to change notification settings - Fork 52
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 service delete event #255
Conversation
Pull Request Test Coverage Report for Build 5028410283
💛 - Coveralls |
@@ -76,7 +76,7 @@ func (h *enqueueRequestsForEndpointsEvent) enqueueImpactedService(queue workqueu | |||
} | |||
|
|||
if err := h.client.Get(context.TODO(), namespaceName, svc); err != nil { | |||
glog.V(2).Infof("enqueueImpactedService, service not found %v\n", err) | |||
glog.V(2).Infof("Event: enqueueImpactedService, service not found %v\n", err) |
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.
let's use V(6)
@@ -29,6 +29,7 @@ func NewEqueueRequestServiceEvent(client client.Client) handler.EventHandler { | |||
|
|||
func (h *enqueueRequetsForServiceEvent) Create(e event.CreateEvent, queue workqueue.RateLimitingInterface) { | |||
service := e.Object.(*corev1.Service) | |||
h.enqueueImpactedService(queue, service) |
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.
being consistent , can we add glog.V(6) here
@@ -37,13 +38,34 @@ func (h *enqueueRequetsForServiceEvent) Update(e event.UpdateEvent, queue workqu | |||
|
|||
func (h *enqueueRequetsForServiceEvent) Delete(e event.DeleteEvent, queue workqueue.RateLimitingInterface) { | |||
service := e.Object.(*corev1.Service) | |||
h.enqueueImpactedService(queue, service) |
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.
same as above
controllers/service_controller.go
Outdated
tgNameD := latticestore.TargetGroupName(svc.Name, svc.Namespace) | ||
TGDeleted := ds.GetTargetGroupsByTG(tgNameD) | ||
for _, tg := range TGDeleted { | ||
glog.V(6).Infof("endpoints change trigger target IP list registration %v and tg %v\n", |
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.
Please update this debugging log line
@@ -72,6 +81,38 @@ func Test_Targets(t *testing.T) { | |||
}, | |||
}, | |||
}, | |||
{ |
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.
Can you add a unit test to test service delete ?
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.
Unit test is covered at line 85-115
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.
also, can u add a new test for just service add without HTTProute stuff...
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.
Created issue for adding e2etest: #257
@@ -72,6 +81,38 @@ func Test_Targets(t *testing.T) { | |||
}, | |||
}, | |||
}, | |||
{ | |||
name: "Add all endpoints to build spec", |
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.
Please update this unit test to match what this unit test for?
LGTM. Please also add more detail on how you fixed the issue. Thanks |
What type of PR is this?
bug
Which issue does this PR fix:
#237
What does this PR do / Why do we need it:
Fix
If an issue # is not available please add repro steps and logs from aws-gateway-controller showing the issue:
Testing done on this change:
make e2etest
Manually run #257
Automation added to e2e:
Will this PR introduce any new dependencies?:
No
Will this break upgrades or downgrades. Has updating a running cluster been tested?:
No
Does this PR introduce any user-facing change?:
No
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.