Skip to content

feat: add critical label checks for InstanceManagers to longhornctl diagnose - #634

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

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

Conversation

@sudeepr34

Copy link
Copy Markdown

Extend the diagnose InstanceManagers check to verify the critical labels controllers use to discover instance managers, using the same types.GetInstanceManagerLabels() the controllers build their selectors from. Missing or unexpected labels are reported as errors.

Related: longhorn/longhorn#9458

Which issue(s) this PR fixes:

Issue longhorn/longhorn#9458

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

…iagnose

Extend the diagnose InstanceManagers check to verify the
critical labels controllers use to discover instance managers,
using the same types.GetInstanceManagerLabels() the controllers
build their selectors from. Missing or unexpected labels are
reported as errors.

Related: longhorn/longhorn#9458

Signed-off-by: Sudeep Reddy <148759887+sudeepr34@users.noreply.github.com>
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.

1 participant