Repository navigation
pillar: use wait helper for k8s node name - #6173
Merged
Merged
Conversation
domainmgr and zedkube each opened their own EdgeNodeInfo subscription and open-coded the DeviceName-to-node-name normalization, then kept the subscription alive without ever re-deriving. EdgeNodeInfo is static for the lifetime of a boot, so a single up-front wait is sufficient. Both agents now resolve the Kubernetes node name once through the shared wait helpers: domainmgr via WaitForNodeName, and zedkube via the new WaitForEdgeNodeInfo, which returns the whole EdgeNodeInfo so zedkube also gets the node UUID it needs. The normalization now lives only in NodeNameFromDeviceName, cross-referenced with its shell counterpart convert_to_k8s_compatible in cluster-utils.sh. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
github-actions
Bot
requested review from
OhmSpectator,
andrewd-zededa,
jsfakian and
naiming-zededa
July 17, 2026 00:23
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6173 +/- ##
==========================================
+ Coverage 22.62% 22.99% +0.37%
==========================================
Files 506 516 +10
Lines 93219 94894 +1675
==========================================
+ Hits 21088 21822 +734
- Misses 70408 71161 +753
- Partials 1723 1911 +188 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The newly added exported WaitForEdgeNodeInfo trips revive's "exported" rule (name stutters as wait.WaitForEdgeNodeInfo), which fails the Yetus gate. Add the same //revive:disable-next-line:exported directive already used on WaitForNodeName; the WaitFor* prefix is kept deliberately to match the pre-existing WaitForVault/WaitForOnboarded helpers in this package. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
milan-zededa
approved these changes
Jul 20, 2026
5 of 7 tasks
5 of 7 tasks
Merged
3 tasks done
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.
Description
Follow-up cleanup to #6121, which added the
WaitForNodeName/NodeNameFromDeviceNamehelpers inutils/waitand left a TODO to convert theremaining open-coders.
domainmgrandzedkubeeach opened their ownEdgeNodeInfosubscription,open-coded the
DeviceName→ Kubernetes-node-name normalization(
strings.ReplaceAll(strings.ToLower(name), "_", "-")), and then kept thesubscription alive in their run loops without ever re-deriving the name.
EdgeNodeInfois static for the lifetime of a boot, so the long-livedsubscription is unnecessary — a single up-front wait yields everything.
Both agents now resolve the node name once via the shared helpers:
domainmgrusesWaitForNodeName.zedkubeuses the newWaitForEdgeNodeInfo, which returns the wholetypes.EdgeNodeInfoso zedkube also gets theDeviceID(node UUID) it usesfor its k8s
node-uuidlookups, and still fires its on-boot side effects(uncordon watcher, Longhorn disk reservation).
The derivation now lives in exactly one Go location,
NodeNameFromDeviceName.Its shell twin
convert_to_k8s_compatible(cluster-utils.sh, used for thek3s node name and the Longhorn node name) can't import Go, so the two are now
cross-referenced by name in both directions to keep them in sync.
No functional change intended — same node name/UUID resolution, same startup
gating, just consolidated.
How to test and validate this PR
make -C pkg/pillarbuilds andgo vetpass for both the default andHV=k(-tags k) tag sets; the change is compile-validated for thekubevirt build that actually exercises this code.
domainmgrandzedkubereach steady state — the node registers under the derived name,and node-scoped operations (cordon/drain, Longhorn disk reservation) work as
before.
Validated on a live amd64 EVE-k device (this branch,
HV=k, under eden/QEMU):domainmgrloggedGot nodeName <uuid>,zedkubeloggedgot nodeName <uuid> nodeuuid <uuid>(both name and UUID from the singleWaitForEdgeNodeInfostruct), nocheckAndSaveEdgeNodeInfolines remained, andk3s registered the node
Ready/control-planeunder that derived name.Changelog notes
None (internal refactor; no user-facing changes).
PR Backports
Checklist
check them.
Validated on amd64 EVE-k (see the results under "How to test" above). arm64 not
exercised; this is an architecture-independent Go refactor of the agent startup
path, also compile- and vet-validated for the default and
HV=ktag sets.