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

Using pointers to pod in node lifecycle controller #83780

Merged
merged 1 commit into from Oct 15, 2019

Conversation

@krzysied
Copy link
Contributor

krzysied commented Oct 11, 2019

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
Setup for #81167

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

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


@krzysied

This comment has been minimized.

Copy link
Contributor Author

krzysied commented Oct 11, 2019

/assign @wojtek-t

Copy link
Member

cheftako left a comment

/lgtm

remaining := false
var updateErrList []error

if len(pods) > 0 {
RecordNodeEvent(recorder, nodeName, nodeUID, v1.EventTypeNormal, "DeletingAllPods", fmt.Sprintf("Deleting all Pods from Node %v.", nodeName))
}

for i := range pods {
pod := &pods[i]
for _, pod := range pods {

This comment has been minimized.

Copy link
@wojtek-t

wojtek-t Oct 14, 2019

Member

It seems this change isn't correct. Here below, you call SetPodTerminationReason,
which is modifying the pod.

So it works now, when what is passed to this method has just been explicitly listed from server. But it will no longer work when listing will be done from informer what you're planning to do.

Basically, what you need to do, is to DeepCopy the pod before you start modifying it.

You need to do a similar audit in all other places.

This comment has been minimized.

Copy link
@krzysied

krzysied Oct 14, 2019

Author Contributor

I've added DeepCopy to DeletePods and MarkPodsNotReady.

@krzysied krzysied force-pushed the krzysied:nc_pod_pointers branch from 130df50 to b1dfa83 Oct 14, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm label Oct 14, 2019
@krzysied

This comment has been minimized.

Copy link
Contributor Author

krzysied commented Oct 14, 2019

/test pull-kubernetes-kubemark-e2e-gce-big

@wojtek-t

This comment has been minimized.

Copy link
Member

wojtek-t commented Oct 14, 2019

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm label Oct 14, 2019
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Oct 14, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: krzysied, wojtek-t

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

@wojtek-t

This comment has been minimized.

Copy link
Member

wojtek-t commented Oct 14, 2019

/retest

@fejta-bot

This comment has been minimized.

Copy link

fejta-bot commented Oct 14, 2019

/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

This comment has been minimized.

Copy link

fejta-bot commented Oct 15, 2019

/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 2b21f08 into kubernetes:master Oct 15, 2019
15 checks passed
15 checks passed
cla/linuxfoundation krzysied authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-kind Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
tide In merge pool.
Details
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Oct 15, 2019
@krzysied krzysied deleted the krzysied:nc_pod_pointers branch Oct 15, 2019
k8s-ci-robot added a commit that referenced this pull request Mar 10, 2020
…82884-#83248-#83320-#83780-#84445-#81167-upstream-release-1.16

Automated cherry pick of fix for #77733 (NodeLifecycleController is overloading kube-apiserver) into release-1.16
k8s-ci-robot added a commit that referenced this pull request Mar 11, 2020
…81839-#82489-#82884-#83248-#83320-#83780-#84445-#81167-upstream-release-1.15

Automated cherry pick of fix for #77733 (NodeLifecycleController is overloading kube-apiserver) into release-1.15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.