Skip to content

Conversation

@maxmoehl
Copy link
Contributor

In K8sClient.getIp it is assumed that after leaving the for loop ipamIP is not nil and the code goes on to access fields of the ipamIP variable, namely the status. The value is previously obtained via K8sClient.doCreateIpamIP which may return (nil nil) when the creating fails due to a reason other than the kubernetes object already existing which could be any number of reasons.

This commit fixes that by explicitly checking the returned ipamIP for nil and erroring out when it is nil. There is a more thorough fix to be done here as K8sClient.doCreateIpamIP should not return (nil nil) in such cases.

In K8sClient.getIp it is assumed that after leaving the for loop ipamIP
is not nil and the code goes on to access fields of the ipamIP variable,
namely the status. The value is previously obtained via
K8sClient.doCreateIpamIP which may return (nil nil) when the creating
fails due to a reason other than the kubernetes object already existing
which could be any number of reasons.

This commit fixes that by explicitly checking the returned ipamIP for nil
and erroring out when it is nil. There is a more thorough fix to be done
here as K8sClient.doCreateIpamIP should not return (nil nil) in such
cases.
@maxmoehl maxmoehl requested a review from damyan December 16, 2025 14:45
@github-actions github-actions bot added size/XS bug Something isn't working labels Dec 16, 2025
@damyan damyan merged commit 18bae4c into main Dec 16, 2025
7 checks passed
@damyan damyan deleted the maxmoehl/nil branch December 16, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants