Commit ab66ab3
topo: skip creating empty meshnet Topology CR for nodes with no links (#26)
When a node has no Links in its meshnet TopologySpec, kne currently
still creates a `Topology` CR with `spec: {}`. meshnetd's
`Get(podName)` RPC then reads the CR, fails the
`unstructured.NestedSlice(... "spec", "links")` lookup with
`!found`, logs `could not find 'Link' array in pod's spec` and
returns an empty Pod struct. The CNI plugin sees `NodeIp == ""`
and aborts the sandbox with the (misleading) error:
plugin type="meshnet" failed (add):
meshnetd provided no HOST_IP address: or HOST_INTF:
Every pod scheduled on a node with no links is then stuck in
FailedCreatePodSandBox loops until kubelet's 4-minute deadline.
Skip the CR creation for unconnected nodes. The meshnet CNI plugin
already handles "no Topology CR for this pod" gracefully
(plugin/meshnet.go cmdAdd treats Get error as `not a topology pod
returning`) and chains through to the next plugin, so the result
is the same as for any other workload on the cluster.
This is a no-op for topologies whose nodes all have links and
significantly improves robustness for sparse/scale-test topologies
where some nodes are intentionally isolated.
Co-authored-by: dn <dn@msupino-dev>1 parent c39e79c commit ab66ab3
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
557 | 570 | | |
558 | 571 | | |
559 | 572 | | |
| |||
0 commit comments