Skip to content

[17.0-stable] pillar: use wait helper for k8s node name - #6811

Merged
eriknordmark merged 2 commits into
lf-edge:17.0-stablefrom
eriknordmark:waitfornodename-17.0-stable
Oct 18, 2026
Merged

eriknordmark merged 2 commits into
lf-edge:17.0-stablefrom
eriknordmark:waitfornodename-17.0-stable

Conversation

@eriknordmark

Copy link
Copy Markdown
Contributor

Description

Backport of #6173 to 17.0-stable, needed as a dependency for the
17.0-stable backport of #6505.

domainmgr and zedkube resolve the Kubernetes node name once, through the
shared utils/wait helpers, instead of each holding a long-lived
EdgeNodeInfo subscription and open-coding the DeviceName → node-name
normalization. No functional change intended.

Both commits cherry-picked with -x, no adaptations: the picks applied clean
and 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 in pkg/pillar, go vet passes for
cmd/domainmgr and utils/wait and, with -tags k, for cmd/zedkube and
cmd/domainmgr, and gofmt -l is clean. End-to-end: on an EVE-k device,
confirm domainmgr logs Got nodeName and zedkube logs got nodeName ... nodeuuid ..., and the node registers Ready under the derived name.

Changelog notes

None (internal refactor; no user-facing changes).

PR Backports

  • 17.0-stable: this PR.
  • 16.0-stable: No — internal cleanup, not a fix.
  • 14.5-stable: No — internal cleanup, not a fix.
  • 13.4-stable: No — internal cleanup, not a fix.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR
  • I've checked the boxes above, or I've provided a good reason why I didn't
    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.

eriknordmark and others added 2 commits October 15, 2026 23:33
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)
@eriknordmark

Copy link
Copy Markdown
Contributor Author

@rene @andrewd-zededa please review: this is a dependency for the 17.0-stable backport of #6505.

@andrewd-zededa andrewd-zededa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.06%. Comparing base (bc36d4f) to head (d382882).
⚠️ Report is 18 commits behind head on 17.0-stable.

Files with missing lines Patch % Lines
pkg/pillar/cmd/zedkube/zedkube.go 0.00% 14 Missing ⚠️
pkg/pillar/utils/wait/waitfor.go 0.00% 13 Missing ⚠️
pkg/pillar/cmd/domainmgr/domainmgr.go 0.00% 8 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eriknordmark
eriknordmark merged commit 4e587ba into lf-edge:17.0-stable Oct 18, 2026
60 of 63 checks passed
@eriknordmark
eriknordmark deleted the waitfornodename-17.0-stable branch October 27, 2026 00:05
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.

3 participants