-
Notifications
You must be signed in to change notification settings - Fork 287
🐛Fix a stacktrace in LB logic by removing listener name from an error message when not set #1853
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
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
Hi @huxcrux. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. DetailsInstructions 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. |
| listener, err := s.loadbalancerClient.UpdateListener(listener.ID, listenerUpdateOpts) | ||
| if err != nil { | ||
| record.Warnf(openStackCluster, "FailedUpdateListener", "Failed to update listener %s: %v", listener.Name, err) | ||
| record.Warnf(openStackCluster, "FailedUpdateListener", "Failed to update listener: %v", 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.
instead of using Name, could we just use ID? So the user has still a way to find which LB wasn't update.
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.
The problem here is that listener is nil due to
| return nil, err |
I can verify this but I think this will result in the same problem
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.
Right, so we would need to save the name or ID before the call. I mean the stack trace would happen on 288 if it was nil there already, so we know the ID existed before the call.
Not the nicest thing to do I guess but it would work...
listenerID := listener.ID
listener, err := s.loadbalancerClient.UpdateListener(...)Or perhaps rather this?
updatedListener, err := s.loadbalancerClient.UpdateListener(...)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.
listenerName is included when this function is called. I change to code to use that variable instead to avoid adding any variables just used for a potential error message
NVM I scrolled a bit to quick in my IDE, I use the first of your suggested fixes to avoid updating multiple other places or overrideing listneer with updatedListener after the null check
|
/ok-to-test |
406bf1d to
d931504
Compare
d931504 to
403c98f
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: huxcrux, mdbooth The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
|
/unhold |
What this PR does / why we need it:
When a load balancer listener fails to be created an stacktrace apperas due to an error message trying to include the name of the listener that failed to be created.
Stacktrace:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):A part of the problem mentioned in #1687
Special notes for your reviewer:
TODOs:
/hold