fix(instancemanager): honor node selector setting while setup the pod#4627
fix(instancemanager): honor node selector setting while setup the pod#4627COLDTURNIP wants to merge 1 commit intolonghorn:masterfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR addresses longhorn/longhorn#12834 by ensuring InstanceManager pod creation honors the system-managed-components-node-selector setting, avoiding rapid failure/recreate loops when the selected node doesn’t satisfy the selector.
Changes:
- Add a new InstanceManager condition reason for node selector mismatch (
NodeSelectorNotMatching). - Check whether the target node matches the system-managed node selector before deciding pod deletion/recreation and before creating a pod.
- Introduce a helper (
isNodeSelectorMatchingForIM) to evaluate selector vs. Kubernetes Node labels.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| k8s/pkg/apis/longhorn/v1beta2/instancemanager.go | Adds a new condition reason constant used to report node selector mismatch. |
| controller/instance_manager_controller.go | Adds selector-vs-node matching logic to prevent creating IM pods on nodes that don’t satisfy the configured selector. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@COLDTURNIP Please address the comments from Copilot. Thanks. |
802b266 to
de650ac
Compare
longhorn-12834 Signed-off-by: Raphanus Lo <yunchang.lo@suse.com>
de650ac to
95cb36a
Compare
Which issue(s) this PR fixes:
Issue longhorn/longhorn#12834
What this PR does / why we need it:
Special notes for your reviewer:
Additional documentation or context