-
Notifications
You must be signed in to change notification settings - Fork 303
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
Emit Events on THC (mis)configuration #2111
Emit Events on THC (mis)configuration #2111
Conversation
Hi @DamianSawicki. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign kl52752 |
2e604b9
to
5002833
Compare
if sp.BackendConfig != nil && sp.BackendConfig.Spec.HealthCheck != nil { | ||
return | ||
} | ||
|
||
THCEnabled, err := annotations.FromService(svc).ShouldEnableTHC() |
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.
move this line at the beginning of the function. I'm not sure if this is buggy or just confusing. And if you are not doing early returns looks like you don't need those defer at all.
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.
Yeah, without early returns defer
is not really needed. I haven't removed it yet because if we are asked to introduce another flag, then defer
will be useful and the flag will be checked between defer
and reading the annotation.
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.
Done.
pkg/utils/serviceport.go
Outdated
@@ -54,6 +64,7 @@ type ServicePort struct { | |||
L4RBSEnabled bool | |||
L7ILBEnabled bool | |||
THCEnabled bool | |||
THCEvents THCEvents |
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.
instead of THCEnabled and THCEvents can you do THCConfiguration and put it there?
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.
Done.
0598811
to
1248b94
Compare
/ok-to-test |
1248b94
to
0d3a993
Compare
/test all |
a4bf4ca
to
eeb8b9a
Compare
/assign aojea |
eeb8b9a
to
38b32ad
Compare
38b32ad
to
a0420f5
Compare
I have some concerns about the supportability of this approach in the future because we have to modify several functions signatures just to cascade down and up the information, I can see two possible problems:
This is basically using events to validate the Ingress object against a flag, I spent some time with @DamianSawicki trying to look for another approaches but we couldn't come up with good alternatives, maybe a more modular approach adding a new validation method and validate the Ingress and all the Services there before calling @DamianSawicki @swetharepakula @kl52752 from the functional pov this lgtm, I defer to you how to proceed, I'm fine with whatever you decide |
a0420f5
to
a2f94d5
Compare
Thanks again @aojea for looking at it with me!
You’re right, we need to be frugal with new parameters and return values. I’ve decreased the number of parameters of The PR does increase the number of return values of
I had another look at the code and it seems that
The risk is not severe as the feature is only about giving feedback to the User. Still, the PR has a unit test |
/unassign aojea |
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.
This PR LGTM. Mostly nits and suggestions
a2f94d5
to
2e27a1b
Compare
Thanks for reviewing @swetharepakula! Suggestions implemented, manual tests look fine. Ready for merge @kl52752. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DamianSawicki, kl52752 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The purpose of the PR is to emit Events on Service/Ingress objects when the UHC health check for the Service has been successfully configured with the Transparent Health Checks (THC) feature or such a configuration has been attempted.