Repository navigation
feat(role): read each node's link medium on its host and report it - #204
Merged
Merged
Conversation
A node in a container or a VM sees only its own virtual interface, so the role controller's probe cannot tell a Mac's Wi-Fi from its Ethernet. The role now reads the medium on the host itself, in every run that publishes the voter labels, and passes it to k3s as github-runner.exadev.com/link (wired, wifi or unknown) beside them. On a Mac with a bridged Colima profile the medium is that of the interface network.interface names, mapped through the hardware port networksetup lists it under; on any other Mac runtime, and on Linux, it is that of the interface the default route leaves by, on Linux from its /sys/class/net entry. files/node-link.sh does the reading so that the probe can share it.
…e with The probe reads its node's github-runner.exadev.com/link label from the nodes it already lists each sample and reports that medium, falling back to its own interface's only when the node has no such label: a k3s container's veth reads unknown, and a VM's virtio NIC reads wired over a Mac's Wi-Fi. Each sample says which it used (link_source), and the controller carries both into fleet-role-status and names the link in its log. The probe now sources the cluster role's link reader from the image rather than keeping its own copy, and the ARC role passes the label's name (github_runner_arc_role_controller_link_label, from the cluster role's) to it and checks it is a label key distinct from the voter labels.
Mearman
marked this pull request as ready for review
November 3, 2026 18:36
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
|
🎉 This PR is included in version 2.29.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The role controller ranks hosts wired before Wi-Fi, but a node in a container or a VM can only see its own virtual interface: every Docker node read
unknown, and a node in a Colima VM would read its virtio NIC as wired whatever the Mac uses. This reads the medium on the host and carries it through tofleet-role-status.The cluster role reads it in each run that publishes the voter labels (
tasks/link.yml,files/node-link.sh) and passes it to k3s asgithub-runner.exadev.com/linkbeside them. On a Mac with a bridged Colima profile it is the medium of the interfacenetwork.interfacenames, from the hardware portnetworksetup -listallhardwareportslists it under (Wi-Fi iswifi, a port named for Ethernet or LAN iswired, anything elseunknown); for any other Mac runtime, and on Linux, it is the medium of the interface the default route leaves by, on Linux from its/sys/class/netentry. Read by hand against the fleet's Macs, the reader giveswififor m1'sen0(the interface its node profile is bridged to) andwiredfor the mini's.The probe now sources the same reader, reports the label's value when its node has one and its own interface's otherwise, and says which (
link_source); the controller puts both in the status and names the link in its log. The ARC role passes the label's name and checks it is a label key distinct from the voter labels.Turning this on for a fleet that already publishes the voter labels adds one label, so its first run recreates each Docker node and restarts each native one, as any label change does.
The values are
wired,wifiandunknown, the vocabulary the probe and the controller's ranking already use.Tests:
tests/unit/test_node_link.py(the macOS reader against stand-ins fornetworksetupandroute, andtasks/link.ymlthrough the role for a bridged, a shared and a non-Colima Mac and a Linux host), the probe's label precedence intest_fleet_role_probe.py, the label in the Docker and native configurations, the ARC role's checks, and therole_controllermesh scenario now asserting that every probe reports the label the role published.Refs #201
Refs #184