ScaledObject: scale-target selectors (name, prefix, labels) by ssakuh · Pull Request #8233 · kedacore/keda · GitHub
Skip to content

ScaledObject: scale-target selectors (name, prefix, labels) - #8233

Open
ssakuh wants to merge 1 commit into
kedacore:mainfrom
ssakuh:pr1-selectors
Open

ssakuh wants to merge 1 commit into
kedacore:mainfrom
ssakuh:pr1-selectors

Conversation

@ssakuh

@ssakuh ssakuh commented Sep 30, 2026

Copy link
Copy Markdown

Controllers that name objects dynamically (Argo Events sensors, GenerateName Deployments) cannot be referenced by a fixed scaleTargetRef.name. This change adds optional namePrefix and labelSelector fields. All clauses combine with AND and must resolve to exactly one object per reconcile.

What changed:

  • API: namePrefix, labelSelector, status.resolvedTargetName. name is now optional when selectors are given.
  • New resolver (pkg/scaling/resolver/scale_target.go): fixed name passes through with no listing; otherwise prefix and labels filter one list call; zero matches hold, several matches fail closed with typed errors.
  • Wired into all actuation paths with the resolved name: replica reads, scale executor (0/1 transitions), fallback, HPA create and retarget, paused path, env injection, controller validation, finalizer restore.
  • Admission webhook: duplicate-target and HPA-ownership checks resolve selectors first (ambiguous or invalid selectors fail fast; not-yet-created targets skip the check like fixed names do).
  • RBAC: no change needed for built-in kinds. Selector use on other kinds fails closed; this is documented in the field comments and the docs PR.

Testing: new unit tests for the resolver, 6 new webhook envtest specs (including a mutation check: they fail without the fix), full controllers envtest suite green.

Checklist

Fixes #8231
Relates to #4188, #5717, #5707
Relates to kedacore/keda-docs#1888, kedacore/charts#914

@ssakuh
ssakuh requested a review from a team as a code owner September 30, 2026 22:51
@github-actions

Copy link
Copy Markdown

@keda-automation
keda-automation requested a review from a team September 30, 2026 22:51
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⛔ Files ignored due to path filters (1)
  • apis/keda/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*.go
⚙️ Run configuration
  • Configuration used: Repository: kedacore/keda/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ef848f1b-61f2-4423-8cbc-db48ab7f6078
📥 Commits

Reviewing files that changed from the base of the PR and between b54fcf4 and 7ff37b6.

⛔ Files ignored due to path filters (1)
  • apis/keda/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*.go

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

ScaledObject target references can use an exact name, name prefix, or label selector. The criteria combine, and resolution requires exactly one workload. Admission, reconciliation, scaling, HPA construction, and finalization use the resolved workload name.

Changes

Scale target resolution

Layer / File(s) Summary
Target contract and resolution
apis/keda/v1alpha1/scaledobject_types.go, config/crd/bases/keda.sh_scaledobjects.yaml, pkg/scaling/resolver/scale_target.go, pkg/scaling/resolver/scale_target_test.go
The API and CRD support optional namePrefix and labelSelector, alongside an optional exact name. The resolver parses target GVKs, applies the criteria, and returns a name only when one workload matches. Status adds resolvedTargetName.
Admission target validation
apis/keda/v1alpha1/scaledobject_webhook.go, apis/keda/v1alpha1/scaledobject_webhook_test.go
Webhook checks resolve targets before HPA ownership, duplicate-target, and CPU/memory validation. Tests cover distinct and conflicting matches, ambiguous matches, unmanaged HPA ownership, cache fallback, and duplicate-race precedence.
Reconciliation and HPA wiring
controllers/keda/scaledobject_controller.go, controllers/keda/hpa.go, controllers/keda/scaledobject_controller_test.go
Reconciliation resolves names for resource checks and paused-replica scaling, and records the resolved name in status. HPA construction uses the resolved name. Tests cover delayed target creation and fixed-name precedence over a matching selector.
Scaling and finalization paths
controllers/keda/scaledobject_finalizer.go, pkg/fallback/fallback.go, pkg/scaling/executor/scale_scaledobjects.go, pkg/scaling/executor/scale_scaledobjects_test.go, pkg/scaling/resolver/scale_resolvers.go, pkg/scaling/resolver/scale_resolvers_test.go
Replica reads, scale execution, fallback checks, and finalization use resolved target names. Scaling events identify the resolved workload. Resolution errors stop scaling; finalization skips replica restoration if resolution fails.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ScaledObject
  participant AdmissionWebhook
  participant ResolveScaleTargetName
  participant KubernetesAPI
  participant HPAController
  ScaledObject->>AdmissionWebhook: submit target reference
  AdmissionWebhook->>ResolveScaleTargetName: resolve reference and GVK
  ResolveScaleTargetName->>KubernetesAPI: list matching target-kind objects
  KubernetesAPI-->>ResolveScaleTargetName: matching objects
  ResolveScaleTargetName-->>AdmissionWebhook: resolved workload name or error
  AdmissionWebhook-->>ScaledObject: admission result
  ScaledObject->>HPAController: reconcile admitted target
  HPAController->>ResolveScaleTargetName: resolve target name
  ResolveScaleTargetName-->>HPAController: resolved workload name
Loading

Suggested reviewers: rickbrouwer

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The target-resolution implementation and its tests support [#8231]. The current change summary also reports new node-read RBAC permissions in controllers/keda/scaledobject_controller.go. Node-read p… Remove the unrelated node-read RBAC changes from this PR, or isolate them in the referenced Nodes-specific change.
Docstring Coverage ⚠️ Warning Docstring coverage is 42.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 14 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: adding name, prefix, and label selectors for ScaledObject scale targets.
Description check ✅ Passed The description directly explains the selector fields, resolution behavior, affected components, tests, and related changes.
Linked Issues check ✅ Passed The PR meets the coding requirements in directly linked issue [#8231]. It adds namePrefix, labelSelector, and status.resolvedTargetName. Resolution combines criteria with AND and requires exactl…
Full details: Out of Scope Changes check

Explanation

The target-resolution implementation and its tests support [#8231]. The current change summary also reports new node-read RBAC permissions in controllers/keda/scaledobject_controller.go. Node-read permissions do not support selector-based target resolution and are unrelated to [#8231].

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: kedacore/keda/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 4cf406b7-529b-442e-bdcd-c6fb6e0176ee

📥 Commits

Reviewing files that changed from the base of the PR and between 81c6b83 and 46d73da.

⛔ Files ignored due to path filters (1)
  • apis/keda/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*.go
📒 Files selected for processing (13)
  • apis/keda/v1alpha1/scaledobject_types.go
  • apis/keda/v1alpha1/scaledobject_webhook.go
  • apis/keda/v1alpha1/scaledobject_webhook_test.go
  • config/crd/bases/keda.sh_scaledobjects.yaml
  • controllers/keda/hpa.go
  • controllers/keda/scaledobject_controller.go
  • controllers/keda/scaledobject_finalizer.go
  • pkg/fallback/fallback.go
  • pkg/scaling/executor/scale_scaledobjects.go
  • pkg/scaling/executor/scale_scaledobjects_test.go
  • pkg/scaling/resolver/scale_resolvers.go
  • pkg/scaling/resolver/scale_target.go
  • pkg/scaling/resolver/scale_target_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread apis/keda/v1alpha1/scaledobject_types.go
Comment thread apis/keda/v1alpha1/scaledobject_webhook.go
Comment thread apis/keda/v1alpha1/scaledobject_webhook.go
Comment thread controllers/keda/scaledobject_controller.go Outdated
Comment thread controllers/keda/scaledobject_controller.go
Comment thread controllers/keda/scaledobject_controller.go
Comment thread pkg/scaling/executor/scale_scaledobjects.go Outdated
@ssakuh

ssakuh commented Sep 30, 2026 •

Copy link
Copy Markdown
Author

All bot findings addressed in 24e18d5:

  • XValidation CEL rule on ScaleTarget: empty name/namePrefix/labelSelector combinations are now rejected at admission instead of failing at reconcile time.
  • Executor handles paused state before replica and target resolution, so no API calls happen while paused.
  • Ambiguous selector match fails closed: the HPA is deleted and reconciliation returns an error instead of scaling an ambiguous target.
  • Duplicate-target guard extracted into findConflictingScaledObject, shared by the webhook and the executor, so two ScaledObjects cannot own one target even when a selector matches late.
  • Controllers suite gains a delayed-target regression test: target created after the ScaledObject clears the error and scales normally.
  • ScaleTargetGVKR removed from the update equality check to avoid re-reconcile hot loops.
  • Nodes list RBAC marker moved out of this commit into the kubernetes-nodes commit (Scalers: kubernetes-nodes trigger (replicas follow node count) #8234), which is the only consumer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Resolve selector-bearing neighboring targets during admission… · scaledobject_webhook.go:497-509

apis/keda/v1alpha1/scaledobject_webhook.go:497-509
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Resolve selector-bearing neighboring targets during admission conflict checks.

findConflictingScaledObject resolves a neighbor only when Name is empty. A neighbor with Name=N and a non-matching NamePrefix or LabelSelector therefore keeps raw N and can falsely conflict with an incoming target resolved to N. Resolve whenever either selector is present. Preserve the fixed-name fast path.

Suggested fix
-		if otherTargetName == "" {
+		if otherTargetName == "" ||
+			so.Spec.ScaleTargetRef.NamePrefix != "" ||
+			so.Spec.ScaleTargetRef.LabelSelector != nil {
🧹 Nitpick comments (1)
pkg/scaling/executor/scale_scaledobjects_test.go (1)

1421-1421: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use selector-based callers in both negative cases.

fixedRef returns before conflict scanning. The distinct-target and unresolvable-neighbor tests therefore do not exercise their stated branches. Use a selector-based caller and fixture for the distinct-target case. In the unresolvable-neighbor case, remove the fixed target owner and call with a selector so the ghost neighbor is the only candidate.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: kedacore/keda/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: c17d3cc5-dc2f-4ff9-baad-211f44ec7bd3

📥 Commits

Reviewing files that changed from the base of the PR and between 46d73da and 24e18d5.

⛔ Files ignored due to path filters (1)
  • apis/keda/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*.go
📒 Files selected for processing (6)
  • apis/keda/v1alpha1/scaledobject_types.go
  • config/crd/bases/keda.sh_scaledobjects.yaml
  • controllers/keda/scaledobject_controller.go
  • controllers/keda/scaledobject_controller_test.go
  • pkg/scaling/executor/scale_scaledobjects.go
  • pkg/scaling/executor/scale_scaledobjects_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Comment thread pkg/scaling/executor/scale_scaledobjects.go Outdated
@ssakuh

ssakuh commented Oct 1, 2026 •

Copy link
Copy Markdown
Author

Reworked in d87d1d3, all bot findings from this round addressed:

  • Deterministic duplicate-target hold: the check lives in resolver.FindConflictingScaledObject, shared by webhook, executor and reconciler. A fixed-name ref always beats a selector-based ref; two selector-based refs defer to the oldest ScaledObject (creationTimestamp, then name). Exactly one side holds, so selector pairs can no longer deadlock with both sides holding while both HPAs actuate. The dead fixed-fixed branch is removed.
  • Selector-involved neighbors (Name plus NamePrefix/LabelSelector) are resolved before comparing, so a neighbor whose criteria match nothing no longer raises a false conflict.
  • Resolve-once per loop: GetCurrentReplicas now returns the resolved target name, and the executor reads and scales that same object (no read-A/scale-B race).
  • verifyHpas no longer trusts a cached zero-match: on errNoScaleTargetMatch it rechecks against the direct client before skipping HPA ownership validation. A confirmed zero-match still skips; direct ambiguity still rejects.
  • Reconciler deletes the HPA and stops the scale loop on both zero-match and ambiguous resolution (idempotent; the error return requeues, so delayed targets still converge). On a lost duplicate-target race the loser deletes its own HPA, stops its loop and returns an error, so it resumes if the winner goes away. Ready=False with a specific reason is the degraded signal; no new condition type was added.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: kedacore/keda/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: ab3b34a8-3c75-4977-8217-11c6bebb2fbe

📥 Commits

Reviewing files that changed from the base of the PR and between 24e18d5 and d87d1d3.

⛔ Files ignored due to path filters (1)
  • apis/keda/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*.go
📒 Files selected for processing (10)
  • apis/keda/v1alpha1/scaledobject_webhook.go
  • apis/keda/v1alpha1/scaledobject_webhook_test.go
  • controllers/keda/scaledobject_controller.go
  • controllers/keda/scaledobject_controller_test.go
  • pkg/fallback/fallback.go
  • pkg/scaling/executor/scale_scaledobjects.go
  • pkg/scaling/resolver/scale_resolvers.go
  • pkg/scaling/resolver/scale_resolvers_test.go
  • pkg/scaling/resolver/scale_target.go
  • pkg/scaling/resolver/scale_target_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread apis/keda/v1alpha1/scaledobject_webhook.go
@ssakuh

ssakuh commented Oct 1, 2026 •

Copy link
Copy Markdown
Author

Round 2 in 05e232b (single commit, force-pushed):

  • Complexity: the duplicate-target loser check is extracted from reconcileScaledObject into ensureSingleTargetOwner (gocyclo back under the limit).
  • Admission neighbor fix: a candidate with Name plus selectors now resolves before comparing, mirroring the runtime helper (same false-conflict class as the executor one).
  • verifyHpas authoritative recheck with a regression test simulating a stale informer cache (cached client sees the HPA but not the workload, direct client sees both): ownership check runs instead of skipping.
  • Tie-break, resolve-once, loser-HPA handling unchanged from the previous round.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: kedacore/keda/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 00f16a23-fa7e-4477-8248-db59f202d075

📥 Commits

Reviewing files that changed from the base of the PR and between d87d1d3 and 05e232b.

⛔ Files ignored due to path filters (1)
  • apis/keda/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*.go
📒 Files selected for processing (6)
  • apis/keda/v1alpha1/scaledobject_webhook.go
  • controllers/keda/scaledobject_controller.go
  • pkg/scaling/executor/scale_scaledobjects.go
  • pkg/scaling/executor/scale_scaledobjects_test.go
  • pkg/scaling/resolver/scale_resolvers.go
  • pkg/scaling/resolver/scale_target_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Comment thread apis/keda/v1alpha1/scaledobject_webhook.go
@ssakuh

ssakuh commented Oct 1, 2026 •

Copy link
Copy Markdown
Author

Round 3 in 966fb20:

  • Admission skips neighbors with unparseable scaleTargetRef instead of rejecting the incoming object because of them.
  • Manifests fixed: the nodes RBAC marker no longer leaks into this commit (it lives only in Scalers: kubernetes-nodes trigger (replicas follow node count) #8234). verify-manifests passes on this tree; the reported config-out-of-date failure was this exact leak.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · This test passes for the wrong reason, and its expectation… · scaledobject_webhook_test.go:166-169

apis/keda/v1alpha1/scaledobject_webhook_test.go:166-169
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

This test passes for the wrong reason, and its expectation contradicts the webhook logic.

fixedSo uses a fixed name and selectorSo uses a prefix. For this pair, incomingWinsDuplicateRace returns true, so findConflictingScaledObject skips the neighbor. No HPA exists, so verifyHpas does not reject either. The first Create therefore succeeds.

Eventually then retries. The retry fails with AlreadyExists, and Should(HaveOccurred()) accepts that error. The test passes even though admission accepted the object.

TestIncomingWinsDuplicateRace (Line 2361) states the opposite rule: "fixed incoming must beat selector other regardless of age." Fix it in one of two ways:

  • Expect the create to succeed. This matches the documented rule that fixed names take precedence.
  • Change the webhook to reject this case.

In both cases, assert the exact error text so that an AlreadyExists error cannot satisfy the assertion.

💚 Proposed fix (keep fixed-name precedence)
-	fixedSo := createScaledObject("so-fixed", namespaceName, "ingress-sensor-abc12", "apps/v1", "Deployment", false, map[string]string{}, "")
-	Eventually(func() error {
-		return k8sClient.Create(context.Background(), fixedSo)
-	}).Should(HaveOccurred())
+	fixedSo := createScaledObject("so-fixed", namespaceName, "ingress-sensor-abc12", "apps/v1", "Deployment", false, map[string]string{}, "")
+	// Fixed-name refs win the runtime tie-break over selector refs.
+	Eventually(func() error {
+		return k8sClient.Create(context.Background(), fixedSo)
+	}).ShouldNot(HaveOccurred())
🧹 Nitpick comments (1)
apis/keda/v1alpha1/scaledobject_webhook.go (1)

520-550: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoff

Reuse workload listings during duplicate admission checks.

Each selector-based neighbor calls resolveScaleTargetName. The function performs a namespace-scoped LIST of the neighbor's workload GVK through unstructured.UnstructuredList. Controller-runtime v0.24.1 does not cache unstructured client reads by default, so these LISTs can reach the API server separately. Many selector-based ScaledObjects can increase admission latency and may approach the webhook timeout.

List each GVK once per findConflictingScaledObject call. Apply each neighbor's label selector, Name, and NamePrefix filters in memory. Preserve the direct-client fallback for an empty cached result.

♻️ Suggested fix
+	listed := map[schema.GroupVersionKind][]unstructured.Unstructured{}
 	for i := range candidates {
 		...
-			resolved, err := resolveScaleTargetName(ctx, kc, so.Namespace, soGckr.GroupVersionKind(), so.Spec.ScaleTargetRef)
+			// Fetch the namespace list for this GVK once, store it in
+			// listed, and match LabelSelector, Name, and NamePrefix
+			// against the stored items in memory.
+			resolved, err := resolveScaleTargetNameFrom(listed, ctx, kc, so.Namespace, soGckr.GroupVersionKind(), so.Spec.ScaleTargetRef)

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: kedacore/keda/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 4dbb9525-1832-4246-b4a9-d19567c2c815

📥 Commits

Reviewing files that changed from the base of the PR and between 05e232b and 966fb20.

⛔ Files ignored due to path filters (1)
  • apis/keda/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*.go
📒 Files selected for processing (2)
  • apis/keda/v1alpha1/scaledobject_webhook.go
  • apis/keda/v1alpha1/scaledobject_webhook_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@ssakuh

ssakuh commented Oct 1, 2026 •

Copy link
Copy Markdown
Author

Round 4 in b54fcf4:

  • Vacuous test fixed: the fixed-over-selector spec now expects admission success (fixed refs win the runtime tie-break) with a rename and rationale comment. The other rejection specs assert exact error text via ValidateCreate, so an AlreadyExists retry error can no longer satisfy them.
  • Admission applies the runtime duplicate precedence (fixed beats selector; oldest selector wins; zero-timestamp creates lose): updating the winning selector is no longer rejected because of its loser. Unit plus admission-level tests.
  • Admission neighbor with unparseable ref is skipped instead of rejecting.

@ssakuh

ssakuh commented Oct 1, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Deferred architecture/priority summary could not be published.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Signed-off-by: Said Sakuh <said.sakuh@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: kedacore/keda/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 2aa0feb3-bab9-409f-8f79-3118858d50b0

📥 Commits

Reviewing files that changed from the base of the PR and between 966fb20 and b54fcf4.

⛔ Files ignored due to path filters (1)
  • apis/keda/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*.go
📒 Files selected for processing (4)
  • apis/keda/v1alpha1/scaledobject_webhook.go
  • apis/keda/v1alpha1/scaledobject_webhook_test.go
  • pkg/scaling/resolver/scale_target.go
  • pkg/scaling/resolver/scale_target_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Comment thread pkg/scaling/resolver/scale_target.go
@ssakuh

ssakuh commented Oct 1, 2026

Copy link
Copy Markdown
Author

Vet fixed in 7ff37b6: the placement-event test imports stayed on this branch while the spec itself lives in #8234. Full go vet ./... is clean on this tree.

@ssakuh

ssakuh commented Oct 1, 2026

Copy link
Copy Markdown
Author

Note on the informer-cache thread (resolved): the typed-list optimization for selector resolution lives in #8234 single commit, which is a superset of this PR. This PR is intentionally untouched so its running checks are not invalidated for a Minor perf item; the behavior here is correct, uncached reads only. Happy to cherry-pick it here too if preferred.

@ssakuh

ssakuh commented Oct 3, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

Proposal: target workloads by name prefix and label selector (exactly one or hold)

1 participant