🐛 Fix the namespace of NAD in NodeSlicePool's ownerRef#614
🐛 Fix the namespace of NAD in NodeSlicePool's ownerRef#614lubronzhan wants to merge 1 commit intok8snetworkplumbingwg:masterfrom
Conversation
Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
a140fde to
cfb62b3
Compare
|
Ohk jsut found out can't set ownerRef to a resource in different namespace. So maybe this hardcoded namespace was intentional. But NAD could be presented in any namespace in the doc https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/docs/configuration.md#namespace-isolation |
|
But is NodeSlicePool supposed to be 1 map to 1 cluster? Then NAD should be in the same namespace, then how does the pod in different namespace reference this NAD |
|
Pod doesn't need to be in the same namespace as a NAD. The Pod just references the NAD via multus annotation / We keep all NADs in one namespace, after all they generally attach to physical networks |
|
IC, in that way, should we have a webhook to reject NAD created in other namespace. Otherwise it will just cause nil pointer exception mentioned in #518 (comment) |
What this PR does / why we need it:
Right now it's hardcoded to whereabout's namespace, but NAD might be deployed in different namespace. If deployed in different namespace, NodeSlicePool will be garbage collected immediate after creation, and following logic in Whereabout will fail and report nil pointer.
Example in comment in this #518 (comment)
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes # #518
Special notes for your reviewer (optional):