-
Notifications
You must be signed in to change notification settings - Fork 9
Prevent MatchingActiveLeases selector from shadowing label selector #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughRefactors MatchingActiveLeases to accept and return a labels.Selector (instead of producing a client.ListOption), and updates callers to wrap the returned selector with client.MatchingLabelsSelector or place it in ListOptions.LabelSelector. Imports updated where needed across controllers, services, and e2e workflow reference changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as Service/Controller
participant Selector as MatchingActiveLeases
participant K8s as Kubernetes API
Note over Caller: Compose selector and list active leases
Caller->>Selector: MatchingActiveLeases(labels.Everything())
Selector-->>Caller: labels.Selector (augmented with active-lease requirement)
Caller->>K8s: List(... LabelSelector=selector ...)
K8s-->>Caller: LeaseList (filtered)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
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 |
| if err := s.List(ctx, &jleases, &kclient.ListOptions{ | ||
| Namespace: namespace, | ||
| LabelSelector: selector, | ||
| LabelSelector: controller.MatchingActiveLeases(selector), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but isn't this going to filter on the labels of the lease itself? should we label the leases with our selector too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/e2e.yaml (1)
19-21: Make jumpstarter-ref robust for workflow_dispatch.
${{ github.event.pull_request.base.ref }}is undefined on manual runs. Provide a sane fallback (e.g.,github.base_reformain) to avoid empty input.with: controller-ref: ${{ github.ref }} # use the matching branch on the jumpstarter repo - jumpstarter-ref: ${{ github.event.pull_request.base.ref }} + jumpstarter-ref: ${{ github.event.pull_request.base.ref || github.base_ref || 'main' }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/e2e.yaml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: deploy-kind
- GitHub Check: tests
- GitHub Check: e2e-tests (ubuntu-24.04-arm)
- GitHub Check: e2e-tests (ubuntu-24.04)
- GitHub Check: e2e-tests-28d6b1cc3b49ab9ae176918ab9709a2e2522c97e
- GitHub Check: lint-go
🔇 Additional comments (1)
.github/workflows/e2e.yaml (1)
17-17: Pin jumpstarter-e2e Action to fixed commit SHA.- - uses: jumpstarter-dev/jumpstarter-e2e@lease-selector + - uses: jumpstarter-dev/jumpstarter-e2e@28bdf0aa84c0f08b86e2d6daaf8ac29b11f769ba
Fixes-Issue: #164
Summary by CodeRabbit
Refactor
Chores