Skip to content
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

dra: enable adding ReservedFor entries through strategic-merge-patch #122276

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Dec 12, 2023

What type of PR is this?

/kind cleanup
/kind api-change

What this PR does / why we need it:

When moving the reservation of a claim for a pod into the PreBind phase in a future PR, multiple different update attempts will be executed concurrently. We want an attempt to succeed if and only if adding the entry passes validation. Without patch strategy and key, strategic-merge-patch replaces the entire ReservedFor instead of adding new entries.

Server-side-apply cannot be used because each attempt may start with a stale ResourceClaim (thus cannot send the entire ReservedFor) and SSA doesn't support merging when using the same manager string. Using different managers (one for each entry) would work, but sounds like a bad hack.

Which issue(s) this PR fixes:

Related-to: #113700

Special notes for your reviewer:

Does this PR introduce a user-facing change?

resource.k8s.io/ResourceClaim (alpha API): the strategic merge patch strategy for the `status.reservedFor` array was changed such that a strategic-merge-patch can add individual entries. This breaks clients using strategic merge patch to update status which rely on the previous behavior (replacing the entire array).

/assign @apelisse

When moving the reservation of a claim for a pod into the PreBind phase in a
future commit, multiple different update attempts will be executed
concurrently. We want an attempt to succeed if and only if adding the entry
passes validation. Without patch strategy and key, strategic-merge-patch
replaces the entire ReservedFor instead of adding new entries.

Server-side-apply cannot be used because each attempt may start with a stale
ResourceClaim (thus cannot send the entire ReservedFor) and SSA doesn't support
merging when using the same manager string. Using different managers (one for
each entry) would work, but sounds like a bad hack.
@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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Dec 12, 2023
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.29 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.29.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Tue Dec 12 10:21:04 UTC 2023.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/code-generation labels Dec 12, 2023
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 12, 2023
@Jefftree
Copy link
Member

/triage accepted
/cc

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 12, 2023
@apelisse
Copy link
Member

apelisse commented Jan 3, 2024

/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 Jan 3, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 194c79fa6804a0e8a897a2beafa95db3453e02f6

@pohly
Copy link
Contributor Author

pohly commented Jan 3, 2024

/assign @msau42

For API approval. It's just a minor tweak which doesn't affect existing code, but blocks further work.

@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@pohly
Copy link
Contributor Author

pohly commented Jan 19, 2024

/label api-review

@k8s-ci-robot k8s-ci-robot added api-review Categorizes an issue or PR as actively needing an API review. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jan 19, 2024
@k8s-ci-robot k8s-ci-robot removed the release-note-none Denotes a PR that doesn't merit a release note. label Jan 24, 2024
@liggitt
Copy link
Member

liggitt commented Jan 24, 2024

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: apelisse, liggitt, pohly

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

The pull request process is described here

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 Jan 24, 2024
@k8s-ci-robot k8s-ci-robot merged commit b37c609 into kubernetes:master Jan 24, 2024
17 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.30 milestone Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/code-generation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: API review completed, 1.30
Development

Successfully merging this pull request may close these issues.

7 participants