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

2.0 prep: Revert "Revert "Use patch to replace update"" #177

Merged
merged 2 commits into from
Aug 16, 2019

Conversation

jsafrane
Copy link
Contributor

/kind cleanup

What this PR does / why we need it:
This PR restores PATCH support in the external attacher. In v2.0 we can change the behavior and also the default RBAC rules that the attacher needs.

Special notes for your reviewer:
The first commit is the same as originally applied by @cwdsuzhou in #149. The second commit openly admits that the fake client / informer is imperfect and enables tests commented out by #149.

I tried to implement the fake PATCH correctly, however, applying []byte patch to existing API object looks impossible.

Does this PR introduce a user-facing change?:

Action required: The external-attacher now uses PATCH HTTP method to update API objects. Please update the attacher RBAC policy to allow the attacher to `patch`  VolumeAttachments and PersistentVolumes. See `deploy/kubernetes/rbac.yaml` for an example.

This reverts commit 7c8996b.

Use PATCH instead of UPDATE. It should prevent some version conflict
errors. In 2.0 we can change the default RBAC policy and add PATCH there.
Work round our imperfect implemetation of PATCH in fake client / informers.
It does not store new version of patched VolumeAttachment to
VolumeAttachment informer and thus the controller has to repeat some
actions.
@k8s-ci-robot k8s-ci-robot added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Aug 16, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 16, 2019
@jsafrane jsafrane changed the title Revert "Revert "Use patch to replace update"" 2.0 prep: Revert "Revert "Use patch to replace update"" Aug 16, 2019
@jsafrane jsafrane mentioned this pull request Aug 16, 2019
@@ -24,7 +24,7 @@ metadata:
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "update"]
verbs: ["get", "list", "watch", "update", "patch"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still need update?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd prefer to have it there, just in case :-)
(btw, I'd prefer if there were just generic "read" and "write" permissions)

@msau42
Copy link
Collaborator

msau42 commented Aug 16, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 16, 2019
@bertinatto
Copy link
Contributor

/retest

@k8s-ci-robot k8s-ci-robot merged commit d1fdcd6 into kubernetes-csi:master Aug 16, 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants