-
Notifications
You must be signed in to change notification settings - Fork 170
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
Bug fix - Add nil pointer check for LoadBalancerProfile in cluster metrics #3695
Conversation
70c1286
to
2d3375a
Compare
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.
LGTM. It doesn't need to be done immediately within this PR, but as soon as we can, we should introduce a panic guard within this metrics function so that future nil pointer dereferences or other panics cannot halt execution on the backend.
/azp run ci,e2e |
Azure Pipelines successfully started running 2 pipeline(s). |
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.
Approved, thanks for this!
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.
LGTM
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.
LGTM!
/azp run e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
Which issue this PR addresses:
ARO-9146
Fixes
What this PR does / why we need it:
If the
doc.OpenShiftCluster.Properties.NetworkProfile.LoadBalancerProfile
is nil, checking for a nildoc.OpenShiftCluster.Properties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs
will cause a panic.Relevant line from stack trace:
Checking for
doc.OpenShiftCluster.Properties.NetworkProfile.LoadBalancerProfile
first will stop a nildoc.OpenShiftCluster.Properties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs
from being de referenced.Test plan for issue:
Covered by unit tests.
Will also create a UDR cluster with this document: https://github.com/Azure/ARO-RP/blob/master/docs/deploy-development-rp.md#run-the-rp-and-create-a-cluster
Is there any documentation that needs to be updated for this PR?
No.
How do you know this will function as expected in production?
Unit tests added pass a nil LoadBalancerProfile on this branch, while causing a panic on master.