Skip to content

Remove multiple pods sharing one claim in prepareResourceClaim#214

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
ngcxy:prepare-resource-claim-refactor
Jun 4, 2026
Merged

Remove multiple pods sharing one claim in prepareResourceClaim#214
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
ngcxy:prepare-resource-claim-refactor

Conversation

@ngcxy
Copy link
Copy Markdown
Contributor

@ngcxy ngcxy commented Jun 2, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Previously prepareResourceClaim implements the iteration over pods reserved for a single claim. This is a preparation work for the scenario where a single claim could be shared among multiple pods, when they're claiming a shared device. Currently this logic is never used since shared device hasn't been introduced yet.

Our finalized design came out that even in shared device scenarios, each pod will get its own distinct ResourceClaim, and the driver handles subinterface creation per claim. Therefore this iteration over multiple pods becomes redundant.

This change removes this logic to simply the preparation logic given this design.

Which issue(s) this PR is related to:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

- Add 1:1 pod-to-claim enforcement
  - Previously the driver allows preparing resource for a claim reserved by multiple pods (in rare and anti-pattern case when they are created simultaneously with the same claim).
  - Now it fails the preparation if the reserved reference is larger than one.
- Non-pod fail-fast
  - Previously a claim containing single non-pod reference would succeed silently.
  - Now it fails resourceClaim preparation with the validation error.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Jun 2, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 2, 2026

Deploy Preview for dranet canceled.

Name Link
🔨 Latest commit f23a2bd
🔍 Latest deploy log https://app.netlify.com/projects/dranet/deploys/6a20aea0f413fb000833e713

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 2, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @ngcxy. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 2, 2026
@ngcxy ngcxy force-pushed the prepare-resource-claim-refactor branch from 5bc6593 to f1da620 Compare June 2, 2026 18:32
Copy link
Copy Markdown
Member

@gauravkghildiyal gauravkghildiyal left a comment

Choose a reason for hiding this comment

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

Thanks @ngcxy

/ok-to-test

Comment thread pkg/driver/dra_hooks.go
Comment thread pkg/driver/dra_hooks.go
@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 3, 2026
@gauravkghildiyal
Copy link
Copy Markdown
Member

/assign

Comment thread pkg/driver/dra_hooks.go
@anson627
Copy link
Copy Markdown
Contributor

anson627 commented Jun 3, 2026

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 3, 2026
@ngcxy ngcxy force-pushed the prepare-resource-claim-refactor branch from f1da620 to f23a2bd Compare June 3, 2026 22:45
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. labels Jun 3, 2026
@gauravkghildiyal
Copy link
Copy Markdown
Member

Thanks!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 4, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauravkghildiyal, ngcxy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 4, 2026
@k8s-ci-robot k8s-ci-robot merged commit ee95059 into kubernetes-sigs:main Jun 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants