-
Notifications
You must be signed in to change notification settings - Fork 39k
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
Use Patch instead of Put to sync pod status #62306
Use Patch instead of Put to sync pod status #62306
Conversation
46eb193
to
d1309b4
Compare
pkg/kubelet/status/status_manager.go
Outdated
|
||
oldStatus := pod.Status.DeepCopy() | ||
newPod, patchBytes, err := statusutil.PatchPodStatus(m.kubeClient, pod.Namespace, pod.Name, *oldStatus, mergePodStatus(*oldStatus, status.status)) | ||
glog.V(3).Infof("Patch status for pod %q with %q", format.Pod(pod), patchBytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the pod status updated only by kubelet ? is there any reason to handle conflicts ?
d1309b4
to
20de2bc
Compare
1fd4e4f
to
42eb210
Compare
/retest |
pkg/util/pod/pod.go
Outdated
"k8s.io/apimachinery/pkg/types" | ||
"k8s.io/api/core/v1" | ||
clientset "k8s.io/client-go/kubernetes" | ||
"k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pod/pod.go: import of k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch, which is not a direct dependency
42eb210
to
5921d9d
Compare
if err != nil { | ||
return true, nil, err | ||
} | ||
// Only supports strategic merge patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ok as a starting point.
@@ -68,23 +71,22 @@ type ObjectScheme interface { | |||
|
|||
// ObjectReaction returns a ReactionFunc that applies core.Action to | |||
// the given tracker. | |||
func ObjectReaction(tracker ObjectTracker) ReactionFunc { | |||
func ObjectReaction(objectTracker ObjectTracker) ReactionFunc { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why renaming?
return true, nil, err | ||
} | ||
|
||
obj, err = objectTracker.Get(gvr, ns, action.GetName()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the Get
necessary? Can you just return obj?
2a72d6e
to
6ffa55f
Compare
/assign thockin for approval |
@freehan: GitHub didn't allow me to assign the following users: approval, for. Note that only kubernetes members and repo collaborators can be assigned. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@caesarxuchao @mengqiy for reviewing Patch helper function and fake kube client changes |
[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process @caesarxuchao @freehan @mengqiy @thockin @yujuhong Pull Request Labels
|
9f2aef0
to
bf6020f
Compare
New changes are detected. LGTM label has been removed. |
Rebased. Reapplying labels. |
/test pull-kubernetes-bazel-test |
/retest Review the full test history for this PR. Silence the bot with an |
4 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
bf6020f
to
85e0d05
Compare
New changes are detected. LGTM label has been removed. |
Rebased. Reapplying labels |
/retest Review the full test history for this PR. Silence the bot with an |
Automatic merge from submit-queue (batch tested with PRs 58920, 58327, 60577, 49388, 62306). If you want to cherry-pick this change to another branch, please follow the instructions here. |
@freehan: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Teach Kubelet about Pod Ready++ Follow up PR of #62306 and #64057, **Only the last 3 commits are new.** Will rebase once the previous ones are merged. ref: https://github.com/kubernetes/community/blob/master/keps/sig-network/0007-pod-ready%2B%2B.md kind/feature priority/important-soon sig/network sig/node /assign @yujuhong ```release-note NONE ```
ref: https://github.com/kubernetes/community/blob/master/keps/sig-network/0007-pod-ready%2B%2B.md