Skip to content

fix: nil pointer dereference when RollingUpdate is nil#132

Open
antoinerrr wants to merge 1 commit intoSlinkyProject:mainfrom
antoinerrr:fix/nil-rolling-update-strategy
Open

fix: nil pointer dereference when RollingUpdate is nil#132
antoinerrr wants to merge 1 commit intoSlinkyProject:mainfrom
antoinerrr:fix/nil-rolling-update-strategy

Conversation

@antoinerrr
Copy link

@antoinerrr antoinerrr commented Feb 27, 2026

Summary

Fix a nil pointer dereference panic in splitUpdatePods when UpdateStrategy.Type is RollingUpdate but UpdateStrategy.RollingUpdate is not set.

Breaking Changes

None

Testing Notes

Pretty self explanatory, on main, if you create a nodeset and try to scale it when the update strategy is RollingUpdate but you do not set UpdateStrategy.RollingUpdate.MaxUnavailable variable, it will panic. This PR add a default

Additional Context

None

Fix

Add a nil guard before accessing RollingUpdate.MaxUnavailable. When RollingUpdate is nil, a nil *IntOrString is passed to GetScaledValueFromIntOrPercent, which already handles it by returning the default value (1).

@antoinerrr antoinerrr force-pushed the fix/nil-rolling-update-strategy branch from 2b1dde6 to bbc04d3 Compare February 27, 2026 09:49
@antoinerrr
Copy link
Author

antoinerrr commented Feb 27, 2026

@SkylerMalinowski @vivian-hafener Hi ! Not sure what are the contributing rules, let me know if I need to change anything

@vivian-hafener vivian-hafener self-assigned this Mar 2, 2026
@vivian-hafener
Copy link
Contributor

Good afternoon @antoinerrr,

Please modify your PR to follow the default template for new PRs: https://github.com/SlinkyProject/slurm-operator/blob/main/.github/pull_request_template.md

Providing testing notes is helpful for reviewers. Testing notes for bug fixes should provide instructions to reproduce a bug on main, along with a walkthrough of how the changed code handles the bug on your feature branch.

Best regards,
Vivian Hafener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants