cluster-api-provider-aws
cluster-api-provider-aws copied to clipboard
🐛 fix(nodegroup): add nil pointer check for nodegroup version
trafficstars
Added a check to ensure that the nodegroup version is not nil before dereferencing it. This prevents potential runtime panics due to nil pointer dereference.
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR adds a nil pointer check for the nodegroup version in the reconcileNodegroupVersion function. This prevents potential runtime panics caused by dereferencing a nil pointer when the nodegroup version is not set.
Which issue(s) this PR fixes: Fixes #5018
Special notes for your reviewer:
This change is essential to ensure the stability of the reconcileNodegroupVersion function by preventing nil pointer dereference issues.
Checklist:
- [x] squashed commits
- [ ] includes documentation
- [ ] includes emojis
- [x] adds unit tests
- [ ] adds or updates e2e tests
Release note:
Fix nil pointer dereference in reconcileNodegroupVersion by adding a check for nodegroup version.