Switch from update to patch for VolumeSnapshot and Content#480
Switch from update to patch for VolumeSnapshot and Content#480ggriffiths wants to merge 1 commit intokubernetes-csi:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ggriffiths The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
b0326c4 to
9d99874
Compare
9d99874 to
1f2c2e7
Compare
7eab1e5 to
e4db6cb
Compare
|
Discovered that stategicmergepatch is not supported for CRs. Working now on an alternative |
e4db6cb to
34d67d2
Compare
462b834 to
85e6ef1
Compare
e8d7316 to
70cc311
Compare
70cc311 to
77923a9
Compare
deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
Outdated
Show resolved
Hide resolved
deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
Outdated
Show resolved
Hide resolved
deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
Outdated
Show resolved
Hide resolved
77923a9 to
237d909
Compare
|
Addressed comments, ready for re-review @xing-yang |
237d909 to
b78eb40
Compare
| contentClone.Status.RestoreSize = nil | ||
| } | ||
| newContent, err := ctrl.clientset.SnapshotV1().VolumeSnapshotContents().UpdateStatus(context.TODO(), content, metav1.UpdateOptions{}) | ||
| newContent, err := utils.PatchVolumeSnapshotContent(content, contentClone, ctrl.clientset, "status") |
There was a problem hiding this comment.
This string "status" is used in multiple places. Can you make it a constant?
b78eb40 to
afbea95
Compare
afbea95 to
cbf8dca
Compare
|
/retest Comparing snapshot-controller logs with other PRs to see if we're seeing less |
46aff65 to
55d6555
Compare
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
55d6555 to
acb00fb
Compare
pkg/utils/patch.go
Outdated
| } | ||
|
|
||
| return newSnapshot, nil | ||
| return updatedSnapshot, nil |
There was a problem hiding this comment.
I thought "newSnapshot" is the latest one returned from API server? Why returning "updatedSnapshot"?
There was a problem hiding this comment.
this was a test commit - I was trying to see if this reduced the 'modified object' error count.
There was a problem hiding this comment.
Reverting the above change as it did not lower the error count.
There was a problem hiding this comment.
Can you take a look of the logs and see if you can tell why we got the "modified object" error? For example, is it because there's another API update happened before the patch?
There was a problem hiding this comment.
Asked SIG API machinery per your suggestion to try and find out. I'll also check the logs to see under what scenarios we face this. The error counts are fairly consistent.
e08f7c7 to
acb00fb
Compare
|
Still investigating ways to lower the error count. merge patch alone with this implementation does not seem to lower the error count. |
|
Findings so far:
|
|
@ggriffiths: PR needs rebase. DetailsInstructions 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. |
|
As this PR did not actually decrease the "object has been modified" error count (see earlier comments), I am closing this for now. I still plan to investigate how this "object has been modified" problem can be solved. It may involve some controller changes. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Switches to use patch instead of update
Which issue(s) this PR fixes:
Fixes #368
Special notes for your reviewer:
n/a
Does this PR introduce a user-facing change?: