Commit 5f07928
committed
Fix OOB IPAM logic by explicitly checking for nil
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.1 parent 77f1cde commit 5f07928
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
0 commit comments