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

Tag structs as atomic #100684

Merged
merged 3 commits into from
Apr 9, 2021
Merged

Tag structs as atomic #100684

merged 3 commits into from
Apr 9, 2021

Conversation

Jefftree
Copy link
Member

@Jefftree Jefftree commented Mar 30, 2021

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

See review of all occurrences of the term "selector" in types.go files

Addresses comments from #100131

Which issue(s) this PR fixes:

Fixes #97970

Related to #97989

Special notes for your reviewer:

I'm not sure what kind of tests we need for these. There are already tests for the generic atomic annotation, I feel like we shouldn't need to test every instance of it. Some are transparent changes because the types are only used in lists that are already atomic.

Does this PR introduce a user-facing change?

SSA treats certain structs as atomic

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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. labels Mar 30, 2021
@Jefftree
Copy link
Member Author

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 30, 2021
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/code-generation sig/auth Categorizes an issue or PR as relevant to SIG Auth. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 5, 2021
@Jefftree
Copy link
Member Author

Jefftree commented Apr 5, 2021

/test pull-kubernetes-integration

@Jefftree Jefftree changed the title [WIP] Tag structs as atomic Tag structs as atomic Apr 6, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 6, 2021
@fejta-bot
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.

@Jefftree
Copy link
Member Author

Jefftree commented Apr 6, 2021

/wg api-expression
/cc @jpbetz
/cc @apelisse

@k8s-ci-robot k8s-ci-robot requested a review from apelisse April 6, 2021 17:00
@apelisse apelisse added this to the v1.22 milestone Apr 7, 2021
@apelisse
Copy link
Member

apelisse commented Apr 7, 2021

/assign @liggitt

@apelisse
Copy link
Member

apelisse commented Apr 7, 2021

Can you maybe squash some of these commits?

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 7, 2021
@Jefftree
Copy link
Member Author

Jefftree commented Apr 7, 2021

Squashed

@Jefftree
Copy link
Member Author

Jefftree commented Apr 7, 2021

/retest

@yangjunmyfm192085
Copy link
Contributor

/test pull-kubernetes-e2e-kind

@liggitt
Copy link
Member

liggitt commented Apr 8, 2021

two questions, lgtm otherwise

@Jefftree
Copy link
Member Author

Jefftree commented Apr 8, 2021

Addressed comments. Marked AllowedTopologies []v1.TopologySelectorTerm usages with listType=atomic.

@liggitt
Copy link
Member

liggitt commented Apr 8, 2021

/retest

@liggitt
Copy link
Member

liggitt commented Apr 8, 2021

/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 Apr 8, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jefftree, liggitt

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 Apr 8, 2021
@k8s-ci-robot k8s-ci-robot merged commit 081ac6b into kubernetes:master Apr 9, 2021
@Jefftree Jefftree deleted the atomic branch December 7, 2021 17:25
@@ -5362,6 +5374,7 @@ type ServiceProxyOptions struct {
// Instead of using this type, create a locally provided and used type that is well-focused on your reference.
// For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +structType=atomic
type ObjectReference struct {
Copy link
Member

@janetkuo janetkuo Jun 2, 2022

Choose a reason for hiding this comment

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

Per discussion with @apelisse it seems wrong to make ObjectReference atomic, because the users specify the apiVersion/Kind/Namespace/Name, and the controller-manager updates the UID. For example, users should be able to specify PV's .spec.claimRef and apply it via SSA, but that will conflict with the PV controller which manages .spec.claimRef.uid.

@Jefftree @liggitt @jpbetz

Copy link
Member

Choose a reason for hiding this comment

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

Good catch Janet, thanks for letting us know. @alexzielenski is looking at it.

Copy link
Member

Choose a reason for hiding this comment

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

Related too, unsurprisingly: fluxcd/flux2#2827

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. 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. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.
Projects
Development

Successfully merging this pull request may close these issues.

Server Side Apply - Selectors are not atomic
8 participants