Skip to content

Add critical label checks for InstanceManagers to longhornctl diagnose - #632

Closed
sudeepr34 wants to merge 1 commit into
longhorn:masterfrom
sudeepr34:feat/diagnose-instancemanager-labels
Closed

sudeepr34 wants to merge 1 commit into
longhorn:masterfrom
sudeepr34:feat/diagnose-instancemanager-labels

Conversation

@sudeepr34

Copy link
Copy Markdown

Extend the diagnose InstanceManagers check to verify that each InstanceManager carries the labels the Longhorn controllers use to discover it (types.GetInstanceManagerLabels). Missing labels or unexpected values are reported as errors, since controllers unable to find a valid instance manager cannot attach or detach volumes.

Related: longhorn/longhorn#9458

Which issue(s) this PR fixes:

Issue longhorn/longhorn#9458

What this PR does / why we need it:

Extends the longhornctl diagnose InstanceManagers check to verify that each InstanceManager carries the labels the Longhorn controllers use to discover it, computed with the same types.GetInstanceManagerLabels() the controllers build their list selectors from (datastore.ListInstanceManagersBySelectorRO). A missing label or unexpected value is reported as an error, since a controller that can't find a valid instance manager can't attach or detach volumes.

Special notes for your reviewer:

go build ./..., go vet, and gofmt are clean. go test ./pkg/remote/diagnose/... passes, including the new TestCheckInstanceManagerLabels (labels present / missing / mismatched cases). The existing TestEvaluateInstanceManagers fixture was updated to build well-formed IMs so it keeps covering the running-state logic.

Additional documentation or context

Extend the diagnose InstanceManagers check to verify that each
InstanceManager carries the labels the Longhorn controllers use to
discover it (types.GetInstanceManagerLabels). Missing labels or unexpected
values are reported as errors, since controllers unable to find a valid
instance manager cannot attach or detach volumes.

Related: longhorn/longhorn#9458

Signed-off-by: Sudeep Reddy <sudeepr34@users.noreply.github.com>
@derekbit

derekbit commented Oct 6, 2026

Copy link
Copy Markdown
Member

Hello @sudeepr34
Thanks for your contribtion. CI failed. Could you check Conventional Commits / commit-lint (pull_request_target)?

@sudeepr34 sudeepr34 closed this Oct 6, 2026
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.

2 participants