MachinePools/OpenStack: Fix nil pointer exception#2253
MachinePools/OpenStack: Fix nil pointer exception#2253openshift-merge-bot[bot] merged 2 commits intoopenshift:masterfrom
Conversation
|
/hold for QE |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2253 +/- ##
==========================================
+ Coverage 58.58% 58.72% +0.13%
==========================================
Files 182 182
Lines 25775 25889 +114
==========================================
+ Hits 15101 15204 +103
- Misses 9402 9414 +12
+ Partials 1272 1271 -1 |
...to pick up openshift/installer#8227 which should fix the nil pointer exception described in the referenced card. HIVE-2476
When MachinePool.Spec.Replicas is unset, as it is when we're doing autoscaling, this used to trigger a nil pointer exception in the vendored installer code in the MachineSets function, which used to assume it would never be nil. A prior commit revendored installer to pick up a fix whereby that assumption is no longer relied upon. Add unit testing to prove that it works. HIVE-2476
8a5c30b to
f59f327
Compare
| // In installer CLI code paths, the replica number is set to 3 by default | ||
| // when install-config does not have any Compute machine-pool, or when the | ||
| // Compute machine-pool does not have the `replicas` property. | ||
| // However, external consumers of this func may not be so kind... | ||
| if pool.Replicas == nil { | ||
| pool.Replicas = ptr.To[int64](0) | ||
| } | ||
|
|
There was a problem hiding this comment.
Reviewer: Upstream fix here 👀
|
security fail to be fixed in #2256 |
|
/test security |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 2uasimojo, lleshchi 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 |
|
@2uasimojo: 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. |
This is *not* a cherry-pick of openshift#2253 / (c6b37ee & f59f327). That solution revendored installer to pick up the fix from upstream. In older branches, this would have dragged in too many dependencies, so we instead fix it "locally" with an explicit nil check. Note also that the original fix added unit tests. We can't do that here either because the new tests rely on the OpenStack UT suite being un-broken [1], which again relied on upstream changes [2][3] we can't pull into older branches. [1] openshift#2251 [2] openshift/installer#8187 [3] openshift/installer#8209 HIVE-2476
This is *not* a cherry-pick of openshift#2253 / (c6b37ee & f59f327). That solution revendored installer to pick up the fix from upstream. In older branches, this would have dragged in too many dependencies, so we instead fix it "locally" with an explicit nil check. Note also that the original fix added unit tests. We can't do that here either because the new tests rely on the OpenStack UT suite being un-broken [1], which again relied on upstream changes [2][3] we can't pull into older branches. [1] openshift#2251 [2] openshift/installer#8187 [3] openshift/installer#8209 HIVE-2476
This is *not* a cherry-pick of openshift#2253 / (c6b37ee & f59f327). That solution revendored installer to pick up the fix from upstream. In older branches, this would have dragged in too many dependencies, so we instead fix it "locally" with an explicit nil check. Note also that the original fix added unit tests. We can't do that here either because the new tests rely on the OpenStack UT suite being un-broken [1], which again relied on upstream changes [2][3] we can't pull into older branches. [1] openshift#2251 [2] openshift/installer#8187 [3] openshift/installer#8209 HIVE-2476
...when MachinePool.Spec.Replicas is unset, as it is when we're doing autoscaling.
The fix was upstream so this PR just revendors to pick it up, and adds unit tests to prove it works.
HIVE-2476