Repository navigation
[17.0-stable] pillar: use wait helper for k8s node name - #6811
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> (cherry picked from commit 41e60c1)
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> (cherry picked from commit baa2c20)
|
@rene @andrewd-zededa please review: this is a dependency for the 17.0-stable backport of #6505. |
andrewd-zededa
left a comment
There was a problem hiding this comment.
LGTM but a side note for a possible follow-on master pr:
#6173 missed one caller. zedmanager still keeps its own long-lived EdgeNodeInfo subscription and checkAndSaveEdgeNodeInfo (pkg/pillar/cmd/zedmanager/zedmanager.go:1895), and it only needs DeviceID. That's the case WaitForEdgeNodeInfo now covers. It wasn't in the original TODO because zedmanager never derived a node name, but it fits this PR's "single up-front wait" reasoning. Fine to keep this backport as a clean pick.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 17.0-stable #6811 +/- ##
===============================================
+ Coverage 22.68% 23.06% +0.37%
===============================================
Files 512 522 +10
Lines 94713 96370 +1657
===============================================
+ Hits 21485 22227 +742
- Misses 71395 72126 +731
- Partials 1833 2017 +184 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Backport of #6173 to
17.0-stable, needed as a dependency for the17.0-stablebackport of #6505.domainmgrandzedkuberesolve the Kubernetes node name once, through theshared
utils/waithelpers, instead of each holding a long-livedEdgeNodeInfosubscription and open-coding theDeviceName→ node-namenormalization. No functional change intended.
Both commits cherry-picked with
-x, no adaptations: the picks applied cleanand the diff is identical to master's apart from hunk-header line numbers.
PR dependencies
None.
How to test and validate this PR
On this branch
go build ./...passes inpkg/pillar,go vetpasses forcmd/domainmgrandutils/waitand, with-tags k, forcmd/zedkubeandcmd/domainmgr, andgofmt -lis clean. End-to-end: on an EVE-k device,confirm
domainmgrlogsGot nodeNameandzedkubelogsgot nodeName ... nodeuuid ..., and the node registersReadyunder the derived name.Changelog notes
None (internal refactor; no user-facing changes).
PR Backports
Checklist
check them.
The source PR was validated on an amd64 EVE-k device; this clean pick was
compile-, vet- and gofmt-checked on the branch, not re-run on a device.