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

add more fields to be stripped from managedFields #74206

Merged
merged 5 commits into from
Feb 27, 2019

Conversation

kwiesmueller
Copy link
Member

What type of PR is this?
/kind bug

What this PR does / why we need it:
Adds more fields to get stripped from managedFields
As requested by @lavalamp in #73681

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added 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/XS Denotes a PR that changes 0-9 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. area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 18, 2019
@kwiesmueller
Copy link
Member Author

/assign @lavalamp
/cc @apelisse @jennybuckley

@apelisse
Copy link
Member

I suspect we want #74207 so we can add a test for this feature.

@kwiesmueller
Copy link
Member Author

yes, I would have done it the other way round but now that you raised concerns about the MakePathOrDie, it would be more reasonable to merge #74207 first.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 23, 2019
@kwiesmueller
Copy link
Member Author

/retest

@@ -233,8 +233,12 @@ var stripSet = fieldpath.NewSet(
fieldpath.MakePathOrDie("metadata", "name"),
fieldpath.MakePathOrDie("metadata", "namespace"),
fieldpath.MakePathOrDie("metadata", "creationTimestamp"),
fieldpath.MakePathOrDie("metadata", "deletionTimestamp"),
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if it'd be generally useful to know who/what has set the deletion timestamp.

Copy link
Member

Choose a reason for hiding this comment

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

But it's set in the delete handler, which doesn't set the field anyway (maybe we should also fix that?). I don't know.

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't this a state from which an object cannot recover?
It might be helpful, but I thought there was the audit log feature to better track things like this?
And do we want to change the object pre deletion? Feels a little off to change managed fields on deletion as it means the user deletes a state and then we modify it before really deleting. Wouldn't expect this.

On the other hand it might be a question of consistency to add this to the delete handler.

"selfLink": "b",
"uid": "b",
"clusterName": "b",
"generation": 0,
"managedFields": [],
Copy link
Member

Choose a reason for hiding this comment

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

You want to see if managedFields gets removed "recursively", so you want to make this non-empty.

@lavalamp
Copy link
Member

And do we want to change the object pre deletion? Feels a little off to change managed fields on deletion as it means the user deletes a state and then we modify it before really deleting. Wouldn't expect this.

Look at what we do for finalizers and gracePeriod. There's a whole lifecycle after a deletion is initiated...

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 26, 2019
@apelisse
Copy link
Member

To sum-up the decision we've made: We don't know how we're going to handle deletionTimestamp in the future, we know it's not set now (because we don't track fields for DELETE). If we decided to do it later, we don't want this code to remove it, so let's ignore it for now.

@apelisse
Copy link
Member

/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 Feb 26, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: apelisse, kwiesmueller

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 Feb 26, 2019
@k8s-ci-robot k8s-ci-robot merged commit b956955 into kubernetes:master Feb 27, 2019
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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants