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

Resetting managed fields and fieldtype #91748

Conversation

apelisse
Copy link
Member

@apelisse apelisse commented Jun 3, 2020

Addresses two of the important issues:

  • Changes the way we reset fields either by sending empty list or, to keep compatibility, send an empty item.
  • If FieldsType is empty, do the right thing (which is, fallback to liveObject) and fallback to empty if that doesn't work either.

What type of PR is this?
/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #90610

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Resolve regression in metadata.managedFields handling in update/patch requests submitted by older API clients

@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-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 3, 2020
@k8s-ci-robot k8s-ci-robot added area/apiserver area/test kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 3, 2020
@apelisse apelisse changed the title WIP: Resetting managed fields and fieldtype Resetting managed fields and fieldtype Jun 4, 2020
@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 Jun 4, 2020
@@ -138,17 +144,32 @@ func (f *FieldManager) Update(liveObj, newObj runtime.Object, manager string) (o
return object, nil
}

// Returns true if the managedFields that have indicate that the user is trying to reset the managedFields.
Copy link
Member Author

@apelisse apelisse Jun 4, 2020

Choose a reason for hiding this comment

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

I'll fix that sentence :-)

@apelisse
Copy link
Member Author

apelisse commented Jun 4, 2020

/assign @liggitt @kwiesmueller
/wg api-expression
/priority important-soon

@k8s-ci-robot k8s-ci-robot added wg/api-expression Categorizes an issue or PR as relevant to WG API Expression. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 4, 2020
@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.

@kwiesmueller
Copy link
Member

/retest

@kwiesmueller
Copy link
Member

/lgtm after the comment is fixed.

@apelisse apelisse force-pushed the resetting-managed-fields-and-fieldtype branch from 536d1ed to 484a2c7 Compare June 4, 2020 16:39
@liggitt
Copy link
Member

liggitt commented Jun 4, 2020

one comment about the empty item check, then lgtm

/hold for #91690

@apelisse apelisse force-pushed the resetting-managed-fields-and-fieldtype branch from fc73f16 to 3f10709 Compare June 5, 2020 19:52
@kwiesmueller
Copy link
Member

/retest

1 similar comment
@apelisse
Copy link
Member Author

apelisse commented Jun 7, 2020

/retest

@apelisse
Copy link
Member Author

apelisse commented Jun 7, 2020

I think hold can be removed since the other PR was merged.

thanks, PTAL @liggitt

@liggitt
Copy link
Member

liggitt commented Jun 8, 2020

/lgtm
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 8, 2020
@liggitt
Copy link
Member

liggitt commented Jun 8, 2020

/retest

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 8, 2020
@liggitt
Copy link
Member

liggitt commented Jun 9, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: apelisse, 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 Jun 9, 2020
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit dbfc3aa into kubernetes:master Jun 9, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jun 9, 2020
@apelisse
Copy link
Member Author

OK I'll cherry-pick this in 1.18, 1.17 and 1.16.

@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 release-note-none Denotes a PR that doesn't merit a release note. labels Jun 11, 2020
k8s-ci-robot added a commit that referenced this pull request Jun 12, 2020
…48-kubernetes-release-1.17

Automated cherry pick of #91748: FieldManager: Reset if we receive nil or a list with one
k8s-ci-robot added a commit that referenced this pull request Jun 12, 2020
…48-kubernetes-release-1.18

Automated cherry pick of #91748: FieldManager: Reset if we receive nil or a list with one
k8s-ci-robot added a commit that referenced this pull request Jun 13, 2020
…48-kubernetes-release-1.16

Automated cherry pick of #91748: FieldManager: Reset if we receive nil or a list with one
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/apiserver area/test 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/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updates with client-go dropping ManagedFieldsEntry.FieldsType breaks
5 participants