Skip to content

pkg/kube: symlink host-local into PATH for k3s v1.34+ compatibility#5788

Merged
eriknordmark merged 1 commit into
lf-edge:masterfrom
mrangana:fix-local-link
Apr 19, 2026
Merged

pkg/kube: symlink host-local into PATH for k3s v1.34+ compatibility#5788
eriknordmark merged 1 commit into
lf-edge:masterfrom
mrangana:fix-local-link

Conversation

@mrangana
Copy link
Copy Markdown
Contributor

@mrangana mrangana commented Apr 11, 2026

Description

k3s v1.34+ validates CNI plugins via exec.LookPath() during agent init. host-local (used by flannel for IPAM) lives in /opt/cni/bin which is not in the default PATH, causing:

failed to find host-local: executable file not found in $PATH

This blocks the k3s server from reaching ready state prevents cluster-reset from proceeding during etcd restore, leaving the cluster permanently stuck until the symlink is manually placed.

Fix: create /usr/bin/host-local -> /opt/cni/bin/host-local before each k3s start in check_start_k3s() and after k3s binary install in update_k3s().

How to test and validate this PR

SSH into eve-k cluster node and enter kube using "eve enter kube"

k3s-stop
k3s server --cluster-reset --cluster-reset-restore-path=/var/lib/rancher/k3s/server/db/snapshots/
k3s-start
ls -la /usr/bin/host-local

The link should exist

Changelog notes

pkg/kube: symlink host-local into PATH for k3s v1.34+ compatibility

PR Backports

- 16.0-stable: No, as the feature is not available there.
- 14.5-stable: No, as the feature is not available there.
- 13.4-stable: No, as the feature is not available there.

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

For backport PRs (remove it if it's not a backport):

  • I've added a reference link to the original PR
  • PR's title follows the template

And the last but not least:

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

Please, check the boxes above after submitting the PR in interactive mode.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.87%. Comparing base (2281599) to head (5dcbcd6).
⚠️ Report is 515 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5788       +/-   ##
===========================================
+ Coverage   19.52%   29.87%   +10.34%     
===========================================
  Files          19       18        -1     
  Lines        3021     2417      -604     
===========================================
+ Hits          590      722      +132     
+ Misses       2310     1549      -761     
- Partials      121      146       +25     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

@rene rene left a comment

Choose a reason for hiding this comment

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

LGTM

k3s v1.34+ validates CNI plugins via exec.LookPath() during agent init.
host-local (used by flannel for IPAM) lives in /opt/cni/bin which is not
in the default PATH, causing:

  failed to find host-local: executable file not found in $PATH

This blocks the k3s server from reaching ready state on every boot and
prevents cluster-reset from proceeding during etcd restore, leaving the
cluster permanently stuck until the symlink is manually placed.

Fix: create /usr/bin/host-local -> /opt/cni/bin/host-local before each
k3s start in check_start_k3s() and after k3s binary install in update_k3s().

Signed-off-by: Manjunath Ranganathaiah <manjunath@zededa.com>
@zedi-pramodh
Copy link
Copy Markdown

@naiming-zededa can you review this to see nothing is broken for eve-k

Copy link
Copy Markdown

@zedi-pramodh zedi-pramodh left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@naiming-zededa naiming-zededa left a comment

Choose a reason for hiding this comment

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

LGTM

@eriknordmark eriknordmark merged commit 75fe3cd into lf-edge:master Apr 19, 2026
33 of 35 checks passed
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.

5 participants