-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Fix csi attach limit node update #70540
Fix csi attach limit node update #70540
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnufied 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 |
9f78fb8
to
8313769
Compare
/assign @verult |
/kind bug |
@@ -166,7 +168,7 @@ func (nim *nodeInfoManager) updateNode(updateFuncs ...nodeUpdateFunc) error { | |||
} | |||
|
|||
if needUpdate { | |||
_, updateErr := nodeClient.Update(node) | |||
_, _, updateErr := nodeutil.PatchNodeStatus(kubeClient.CoreV1(), types.NodeName(node.Name), originalNode, node) |
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.
It's not always the node status that gets updated. For example, for labels are added to the Node object for topology.
Dumb question: why wasn't it working before?
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.
Patching status also updates labels and annotations.
Dumb question: why wasn't it working before?
I am not sure I understand. It never updated attach limits in node's allocatable/capacity. it never worked. The unit tests are not enough to capture this stuff. I am working on e2e to make sure this is covered.
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.
Previously the fields are updated in the fetched Node object directly, and the object is then passed to Update()
. So Update()
still sent the request with updated fields right? Why weren't allocatable/capacity updated?
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.
We discussed this offline. Hope that answers it.
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.
Added a note about why we are using PatchNodeStatus
here.
8313769
to
e12fbd5
Compare
/test pull-kubernetes-e2e-kops-aws |
/lgtm |
/hold |
e12fbd5
to
889468b
Compare
/lgtm |
/hold cancel |
…0-upstream-release-1.12 Automated cherry pick of #70540: Fix csi volume attach limit
Fix node's allocatable/capacity not being updated with CSI volume limits.
Fixes #70541
I will cover this with e2e but not sure if we want to block behind - kubernetes-csi/csi-test#127
For now I have manually verified that this works.
/sig storage