Skip to content

fix(restart): handle daemonset names with dashes in InferNextStartType - #1934

Open
magic-peach wants to merge 1 commit into
kmesh-net:mainfrom
magic-peach:fix-bpf-restart-daemonset-name
Open

magic-peach wants to merge 1 commit into
kmesh-net:mainfrom
magic-peach:fix-bpf-restart-daemonset-name

Conversation

@magic-peach

Copy link
Copy Markdown
Contributor

/kind bug

InferNextStartType grabs the daemonset name by splitting POD_NAME on "-" and taking the first piece. That only works if the daemonset is literally named one word. Install through the helm chart with a release name that doesn't already contain "kmesh" and kmesh.fullname renders as e.g. "cluster-kmesh", so a pod like cluster-kmesh-x7g2p gets looked up as daemonset "cluster", which doesn't exist. The Get() errors out and it always falls back to Normal start, even on a real restart where it should detect Restart/Update and reuse the existing bpf state.

Pulled the derivation into its own daemonSetNameFromPod so it strips only the trailing random suffix instead of keeping only the first segment.

NONE

InferNextStartType looks up the daemonset by taking podName[0] after
splitting on '-', which only works if the daemonset itself is a
single word. Install via the helm chart and the fullname template can
easily produce something like 'cluster-kmesh', so a pod named
cluster-kmesh-x7g2p was getting looked up as just 'cluster', which
doesn't exist - the Get() call fails and it silently falls back to
Normal start every time instead of detecting Restart/Update.

Pulled the derivation out into daemonSetNameFromPod, which strips only
the last dash segment instead of keeping only the first one.

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
Copilot AI lite review requested due to automatic review settings August 17, 2026 18:47
@kmesh-bot kmesh-bot added the kind/bug Something isn't working label Aug 17, 2026

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kmesh-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign okabe-rintarou-0 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 39.56%. Comparing base (32fe3df) to head (38ba69d).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/bpf/restart/bpf_restart.go 80.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
pkg/bpf/restart/bpf_restart.go 8.51% <80.00%> (+8.51%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae15e8a...38ba69d. Read the comment docs.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants