Bug 2095229: desiredRouterDeployment: Check for nil hostNetwork#780
Conversation
Check whether the ingresscontroller's status.endpointPublishingStrategy.hostNetwork field is nil before trying to dereference it. Before this commit, the operator would crash-loop with a nil pointer dereference if the cluster had been upgraded from an earlier version of OpenShift where the cluster had had an ingresscontroller with status.endpointPublishingStrategy.type set to "HostNetwork". This commit fixes bug 2095229. https://bugzilla.redhat.com/show_bug.cgi?id=2095229 Follow-up to commit af653f9. * pkg/operator/controller/ingress/deployment.go (desiredRouterDeployment): Check whether the ingresscontroller's status.endpointPublishingStrategy.hostNetwork field is nil before trying to dereference it. * pkg/operator/controller/ingress/deployment_test.go (TestDesiredRouterDeploymentHostNetworkNil): New test. Verify that desiredRouterDeployment behaves correctly when the ingresscontroller's status.endpointPublishingStrategy.type is "HostNetwork" but status.endpointPublishingStrategy.hostNetwork is nil.
|
@Miciah: This pull request references Bugzilla bug 2095229, which is invalid:
Comment DetailsIn response to this:
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. |
|
/bugzilla refresh |
|
@Miciah: This pull request references Bugzilla bug 2095229, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: frobware, Miciah 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 |
|
@Miciah: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
@Miciah: All pull requests linked via external trackers have merged: Bugzilla bug 2095229 has been moved to the MODIFIED state. DetailsIn response to this:
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. |
Check whether the ingresscontroller's
status.endpointPublishingStrategy.hostNetworkfield is nil before trying to dereference it.Before this change, the operator would crash-loop with a nil pointer dereference if the cluster had been upgraded from an earlier version of OpenShift where the cluster had had an ingresscontroller with
status.endpointPublishingStrategy.typeset to "HostNetwork".Follow-up to #694.
pkg/operator/controller/ingress/deployment.go(desiredRouterDeployment): Check whether the ingresscontroller'sstatus.endpointPublishingStrategy.hostNetworkfield is nil before trying to dereference it.pkg/operator/controller/ingress/deployment_test.go(TestDesiredRouterDeploymentHostNetworkNil): New test. Verify thatdesiredRouterDeploymentbehaves correctly when the ingresscontroller'sstatus.endpointPublishingStrategy.typeis "HostNetwork" butstatus.endpointPublishingStrategy.hostNetworkis nil.