Skip to content

topo: skip creating empty meshnet Topology CR for nodes with no links#26

Merged
msupinodn merged 1 commit into
mainfrom
fix/skip-empty-meshnet-topology
May 28, 2026
Merged

topo: skip creating empty meshnet Topology CR for nodes with no links#26
msupinodn merged 1 commit into
mainfrom
fix/skip-empty-meshnet-topology

Conversation

@msupinodn

Copy link
Copy Markdown
Collaborator

Summary

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. 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 expires, and the only fix is to manually kubectl delete topology … for the offending CRs.

Fix

Skip CR creation when len(spec.Spec.Links) == 0.

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 resulting behaviour is identical to any other non-topology workload on the cluster.

This is a no-op for topologies whose nodes all have links, and substantially improves robustness for sparse / scale-test topologies where some nodes are intentionally isolated.

Test plan

  • go vet ./topo/... clean.
  • Reproduced end-to-end with a 200-node Alpine topology where ~30% of nodes had no random links — before this change those pods got stuck; after, they come up cleanly without the kubectl delete topology workaround.

Made with Cursor

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.
@msupinodn msupinodn merged commit ab66ab3 into main May 28, 2026
4 checks passed
@msupinodn msupinodn deleted the fix/skip-empty-meshnet-topology branch May 28, 2026 08:13
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.

1 participant