You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
compute-domain: only prepare daemon claims from driver namespaces - #1650
The plugin now rejects daemon claims outside NAMESPACE and ADDITIONAL_NAMESPACES. The webhook rejects ComputeDomainDaemonConfig outside them. The chart passes the controller's ADDITIONAL_NAMESPACES to both.
ADDITIONAL_NAMESPACES lists old driver namespaces from upgrades that may still run ComputeDomain daemons. Accepting them keeps those daemons working across an upgrade.
Does this PR introduce a user-facing change?
The ComputeDomain kubelet plugin and webhook now accept ComputeDomain daemon claims only in the driver namespace and the namespaces in the controller's ADDITIONAL_NAMESPACES.
The plugin now rejects daemon claims outside NAMESPACE and
ADDITIONAL_NAMESPACES. The webhook rejects ComputeDomainDaemonConfig
outside them. The chart passes the controller's ADDITIONAL_NAMESPACES
to both.
kubernetes-prowBot
added
approved
Indicates a PR has been approved by an approver from all required OWNERS files.
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
labels
Nov 22, 2026
The kubelet plugin and webhook now restrict daemon claims and ComputeDomainDaemonConfig requests to the driver namespace and configured additional namespaces. Helm passes additional namespace settings to both components. The kubelet plugin returns a permanent error for a claim outside the allowed namespaces. The webhook rejects an out-of-allowlist request when its namespace allowlist is configured.
The change restricts daemon claims to the driver namespace and the configured additional namespaces. Standard installs should see no change. Two edge cases remain: a disallowed claim can receive a retryable overlap error before the permanent namespace error, and an already-completed claim in a namespace removed from the allowlist keeps its cached success after a plugin restart. Both are low impact and can be addressed in a follow-up.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
Issue #1648 has one active direct link. Its coding requirements are: (1) kubelet plugin reads ADDITIONAL_NAMESPACES and rejects daemon claims outside NAMESPACE and that list with a permanent Prepare e…
Provide readable diffs or file blobs for cmd/webhook/main.go, cmd/webhook/main_test.go, and the Helm templates (_helpers.tpl, kubeletplugin.yaml, webhook-deployment.yaml) at the reviewed head. Confirm that the webhook rejects ComputeDomainD…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title names the main change: ComputeDomain daemon claims are prepared only when they come from driver namespaces. The raw summary shows the kubelet plugin now rejects daemon claims outside the con…
Description check
The description states that the kubelet plugin and webhook now reject daemon claims outside NAMESPACE and ADDITIONAL_NAMESPACES, that the chart passes the controller's ADDITIONAL_NAMESPACES to both, a…
Out of Scope Changes check
All changes map to the requirements of #1648. The device_state.go diff adds only the namespace guard, its helper, and the matching tests. The change summaries describe the remaining changes as the web…
Full details: Title check
Explanation
The title names the main change: ComputeDomain daemon claims are prepared only when they come from driver namespaces. The raw summary shows the kubelet plugin now rejects daemon claims outside the configured driver namespace and additional namespaces, which matches the title. The title does not mention the webhook or Helm chart changes, but it does not need to cover every detail.
Full details: Description check
Explanation
The description states that the kubelet plugin and webhook now reject daemon claims outside NAMESPACE and ADDITIONAL_NAMESPACES, that the chart passes the controller's ADDITIONAL_NAMESPACES to both, and that it fixes issue #1648. This relates directly to the changeset, which touches the plugin, webhook, tests, and Helm templates.
Full details: Out of Scope Changes check
Explanation
All changes map to the requirements of #1648. The device_state.go diff adds only the namespace guard, its helper, and the matching tests. The change summaries describe the remaining changes as the webhook namespace options and validation, the webhook tests, the plugin flag, and the Helm wiring for the same two variables. No change in the summaries touches unrelated behavior. The release note matches the plugin and webhook behavior. The alternatives in the issue (ResourceQuota, separate admission policy) are not implemented, which is correct because they are not requested scope.
The webhook and Helm conclusions rely on summaries, because the webhook diff could not be read. This limits the check, but no unrelated change is shown.
Full details: Linked Issues check
Explanation
Issue #1648 has one active direct link. Its coding requirements are: (1) kubelet plugin reads ADDITIONAL_NAMESPACES and rejects daemon claims outside NAMESPACE and that list with a permanent Prepare error; (2) webhook rejects ComputeDomainDaemonConfig outside those namespaces; (3) Helm passes the controller's ADDITIONAL_NAMESPACES to the plugin and the webhook.
Requirement (1) is verified in source. The diff of cmd/compute-domain-kubelet-plugin/device_state.go adds assertDaemonClaimNamespace. It allows a non-empty namespace equal to s.config.flags.namespace or to a trimmed entry of s.config.flags.additionalNamespaces. applyComputeDomainDaemonConfig calls it and wraps the error in permanentError. The flag source is the --additional-namespaces flag and ADDITIONAL_NAMESPACES env var, per the change summary of cmd/compute-domain-kubelet-plugin/main.go.
Requirements (2) and (3) rest on the change summaries only. The diff for cmd/webhook/main.go could not be read: the changed blobs are missing from the checkout. The webhook behavior (allowlist from NAMESPACE and ADDITIONAL_NAMESPACES, rejection with a validation message), the _helpers.tpl additionalNamespaces helper, kubeletplugin.yaml, and webhook-deployment.yaml are therefore unverified in source. The webhook test additions are also unverified.
The chart and webhook code paths are not confirmed. Issue text and the PR description state no behavior change for standard installs; this was not checked against the controller code.
Resolution
Provide readable diffs or file blobs for cmd/webhook/main.go, cmd/webhook/main_test.go, and the Helm templates (_helpers.tpl, kubeletplugin.yaml, webhook-deployment.yaml) at the reviewed head. Confirm that the webhook rejects ComputeDomainDaemonConfig when the request namespace is not in NAMESPACE plus ADDITIONAL_NAMESPACES, and that the chart sets both variables on the webhook and the kubelet plugin.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
782-783: Minor · Functional Correctness · Quick win
Check daemon namespaces before the overlap check in Prepare.
Prepare runs validateNoOverlappingPreparedDevices (device_state.go:226) before applyPreparePlan reaches the namespace guard in applyComputeDomainDaemonConfig (device_state.go:782). The overlap error is not permanent, so the driver retries it. A claim outside NAMESPACE and ADDITIONAL_NAMESPACES that requests a daemon device held by a completed non-admin claim can get a retryable error first. It gets the required permanent namespace error only after the overlapping checkpoint entry clears. If that entry does not clear, the claim does not get the permanent error.
Run the daemon namespace check in preflight, before the overlap check. Keep the overlap error retryable for allowed claims. Add a regression test that calls Prepare, not only applyComputeDomainDaemonConfig. The exact placement depends on how daemon configs are identified in buildPreparePlan, so this is stated as required behavior rather than a patch.
782-782: Minor · Functional Correctness · Low value
Apply the namespace allowlist to completed daemon claims after a plugin restart.
Prepare returns cached devices for a PrepareCompleted claim before buildPreparePlan runs the daemon namespace check. A same-boot restart keeps that checkpoint. If a completed daemon claim's namespace is removed from ADDITIONAL_NAMESPACES, Prepare still returns success for that claim, so the new restriction does not apply to it.
The impact is limited. The claim was admitted while its namespace was allowed. The cached response returns devices that were already prepared, and it grants no new devices or access.
Choose and document how completed claims in disallowed namespaces are handled, either a permanent error or retention until Unprepare. Keep cached success for claims in allowed namespaces. Add a restart regression test that covers a completed daemon claim whose namespace is no longer allowed.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
approvedIndicates a PR has been approved by an approver from all required OWNERS files.cncf-cla: yesIndicates the PR's author has signed the CNCF CLA.kind/featureCategorizes issue or PR as related to a new feature.release-noteDenotes a PR that will be considered when it comes time to generate release notes.size/LDenotes a PR that changes 100-499 lines, ignoring generated files.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind feature
What this PR does / why we need it:
The plugin now rejects daemon claims outside NAMESPACE and ADDITIONAL_NAMESPACES. The webhook rejects ComputeDomainDaemonConfig outside them. The chart passes the controller's ADDITIONAL_NAMESPACES to both.
Which issue(s) this PR is related to:
Fixes #1648
Special notes for your reviewer:
ADDITIONAL_NAMESPACESlists old driver namespaces from upgrades that may still run ComputeDomain daemons. Accepting them keeps those daemons working across an upgrade.Does this PR introduce a user-facing change?
Additional documentation (design docs, usage docs, etc.):
Checklist
make check testpasses locallymake check-generatepasses ifapi/changed (CRDs, deepcopy, informers, listers, clientset)make check-modulespasses ifgo.mod/go.sumchangeddeployments/helm) updated if flags, RBAC, or defaults changed