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

update volumeAttachment to v1 #200

Merged
merged 1 commit into from
Apr 17, 2020

Conversation

cwdsuzhou
Copy link
Contributor

@cwdsuzhou cwdsuzhou commented Dec 24, 2019

What type of PR is this?

/kind feature

What this PR does / why we need it:
update volumeAttachment to v1

Which issue(s) this PR fixes:

Fixes #196

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Update volumeAttachment to v1

Action required: RBAC policy was updated to allow the external-attacher to patch VolumeAttachment.Status

I am not sure if we need update CSINode to V1

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 24, 2019
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 24, 2019
@cwdsuzhou
Copy link
Contributor Author

/assign @jsafrane @msau42

@cwdsuzhou
Copy link
Contributor Author

seem we should update the api version of k8s integration test first.

@msau42
Copy link
Collaborator

msau42 commented Jan 2, 2020

@cwdsuzhou can you provide more details on why the test is failing? The K8s API server can support both v1beta and v1 objects so the consumers should be able to use either version successfully.

@cwdsuzhou
Copy link
Contributor Author

/retest

@cwdsuzhou
Copy link
Contributor Author

Jan  3 02:17:47.615: FAIL: Unexpected error:
    <*errors.errorString | 0xc00239f160>: {
        s: "expected pod \"pod-subpath-test-dynamicpv-dzfs\" success: Gave up after waiting 5m0s for pod \"pod-subpath-test-dynamicpv-dzfs\" to be \"success or failure\"",
    }
    expected pod "pod-subpath-test-dynamicpv-dzfs" success: Gave up after waiting 5m0s for pod "pod-subpath-test-dynamicpv-dzfs" to be "success or failure"
occurred

Full Stack Trace
k8s.io/kubernetes/test/e2e/framework.(*Framework).testContainerOutputMatcher(0xc00209a8c0, 0x4a944e9, 0x7, 0xc0016a8c00, 0x0, 0xc001b8b1b0, 0x1, 0x1, 0x4c7f108)
	/home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/framework/util.go:829 +0x1ee
k8s.io/kubernetes/test/e2e/framework.(*Framework).TestContainerOutput(...)
	/home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:543
k8s.io/kubernetes/test/e2e/storage/testsuites.testReadFile(0xc00209a8c0, 0xc0016c99c0, 0x16, 0xc0016a8c00, 0x0)
	/home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/storage/testsuites/subpath.go:719 +0x1f5
k8s.io/kubernetes/test/e2e/storage/testsuites.(*subPathTestSuite).DefineTests.func18()
	/home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/storage/testsuites/subpath.go:407 +0x23a
k8s.io/kubernetes/test/e2e.RunE2ETests(0xc002652d00)
	_output/local/go/src/k8s.io/kubernetes/test/e2e/e2e.go:110 +0x30a
k8s.io/kubernetes/test/e2e.TestE2E(0xc002652d00)
	_output/local/go/src/k8s.io/kubernetes/test/e2e/e2e_test.go:112 +0x2b
testing.tRunner(0xc002652d00, 0x4c7aad0)
	/usr/local/go/src/testing/testing.go:909 +0xc9
created by testing.(*T).Run

logs are about timeout

@cwdsuzhou cwdsuzhou force-pushed the Dec/update_va2v1 branch 2 times, most recently from ad86ff4 to ec029c5 Compare January 3, 2020 08:37
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 3, 2020
@cwdsuzhou cwdsuzhou force-pushed the Dec/update_va2v1 branch 2 times, most recently from 67f481e to e457386 Compare January 3, 2020 08:54
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 3, 2020
@msau42
Copy link
Collaborator

msau42 commented Jan 3, 2020

Looks like attacher sidecar successfully updated VA object:

I0103 09:13:50.426917       1 controller.go:198] Started VA processing "csi-8db4233ad3c6a8b2e98e71892654c43f63aeb919003873407101f72753f70a96"
I0103 09:13:50.426951       1 trivial_handler.go:53] Trivial sync[csi-8db4233ad3c6a8b2e98e71892654c43f63aeb919003873407101f72753f70a96] started
I0103 09:13:50.426956       1 util.go:36] Marking as attached "csi-8db4233ad3c6a8b2e98e71892654c43f63aeb919003873407101f72753f70a96"
I0103 09:13:50.430162       1 util.go:49] Marked as attached "csi-8db4233ad3c6a8b2e98e71892654c43f63aeb919003873407101f72753f70a96"
I0103 09:13:50.430187       1 trivial_handler.go:61] Marked VolumeAttachment csi-8db4233ad3c6a8b2e98e71892654c43f63aeb919003873407101f72753f70a96 as attached

However, controller manager does not seem to see the update:

I0103 09:13:50.423037       1 reconciler.go:288] attacherDetacher.AttachVolume started for volume "pvc-f6bc1fa5-cbf8-495b-a9e2-78e573614ed0" (UniqueName: "kubernetes.io/csi/hostpath.csi.k8s.io^59c001b5-2e09-11ea-aab0-525e4f5fc867") from node "csi-prow-worker" 
E0103 09:15:50.427115       1 csi_attacher.go:205] kubernetes.io/csi: attacher.WaitForAttach timeout after 2m0s [volume=59c001b5-2e09-11ea-aab0-525e4f5fc867; attachment.ID=csi-8db4233ad3c6a8b2e98e71892654c43f63aeb919003873407101f72753f70a96]

@cwdsuzhou
Copy link
Contributor Author

@msau42 when it updates to v1, I find patch actually failed, but error does not return.

I will take a closer look at it! Maybe it is an issue of apiserver.

@liggitt
Copy link

liggitt commented Jan 4, 2020

Patching fields underneath the status field must be done via the status subresource in v1

@@ -724,7 +725,7 @@ func (h *csiHandler) patchVA(va, clone *storage.VolumeAttachment) (*storage.Volu
return va, err
}

newVa, err := h.client.StorageV1beta1().VolumeAttachments().Patch(va.Name, types.MergePatchType, patch)
newVa, err := h.client.StorageV1().VolumeAttachments().Patch(va.Name, types.MergePatchType, patch)
Copy link

Choose a reason for hiding this comment

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

if this is changing status fields, it must submit the patch to the status subresource

@@ -316,7 +317,7 @@ func (h *csiHandler) prepareVANodeID(va *storage.VolumeAttachment, nodeID string
}

func (h *csiHandler) saveVA(va *storage.VolumeAttachment, patch []byte) (*storage.VolumeAttachment, error) {
newVA, err := h.client.StorageV1beta1().VolumeAttachments().Patch(va.Name, types.MergePatchType, patch)
newVA, err := h.client.StorageV1().VolumeAttachments().Patch(va.Name, types.MergePatchType, patch)
Copy link

Choose a reason for hiding this comment

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

@@ -83,7 +84,7 @@ func markAsDetached(client kubernetes.Interface, va *storage.VolumeAttachment) (
if err != nil {
return va, err
}
newVA, err := client.StorageV1beta1().VolumeAttachments().Patch(va.Name, types.MergePatchType, patch)
newVA, err := client.StorageV1().VolumeAttachments().Patch(va.Name, types.MergePatchType, patch)
Copy link

Choose a reason for hiding this comment

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

@@ -41,7 +42,7 @@ func markAsAttached(client kubernetes.Interface, va *storage.VolumeAttachment, m
if err != nil {
return va, err
}
newVA, err := client.StorageV1beta1().VolumeAttachments().Patch(va.Name, types.MergePatchType, patch)
newVA, err := client.StorageV1().VolumeAttachments().Patch(va.Name, types.MergePatchType, patch)
Copy link

Choose a reason for hiding this comment

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

@@ -34,6 +34,9 @@ rules:
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm new rbac is going to require us to bump major versions again. @jsafrane are we ready for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need change e2e test of k8s ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't remember any other deprecation that would require version bump. It would be nice to include also v1 of CSINode and VolumeAttachment and thus bumping of min. k8s version.

Copy link
Contributor

Choose a reason for hiding this comment

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

I created #212 not to forget to bump major version and go module.

I think we can do 3.0 in this cycle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jsafrane are we ready to do 3.0 now? This is one of the items preventing us from adding CSI tests to conformance, as conformance cluster only enables v1 objects.

@cwdsuzhou
Copy link
Contributor Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 18, 2020
@jsafrane jsafrane mentioned this pull request Jan 31, 2020
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2020
@jsafrane
Copy link
Contributor

@cwdsuzhou, I think it's time for 3.0 release (together with Kubernetes 1.19). Can you please rebase the PR?

@cwdsuzhou
Copy link
Contributor Author

@cwdsuzhou, I think it's time for 3.0 release (together with Kubernetes 1.19). Can you please rebase the PR?

sure, thanks

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 17, 2020
@cwdsuzhou
Copy link
Contributor Author

/hold cc

@cwdsuzhou
Copy link
Contributor Author

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 17, 2020
@jsafrane
Copy link
Contributor

jsafrane commented Apr 17, 2020

lgtm-ish.
Please edit the release note in the first comment - in addition to what is there now, it should also say "Action required: RBAC policy was updated to allow the external-attacher to patch VolumeAttachment.Status" (or something like that).

@k8s-ci-robot k8s-ci-robot added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Apr 17, 2020
@cwdsuzhou
Copy link
Contributor Author

lgtm-ish.
Please edit the release note in the first comment - in addition to what is there now, it should also say "Action required: RBAC policy was updated to allow the external-attacher to patch VolumeAttachment.Status" (or something like that).

Updated

@@ -116,7 +119,7 @@ func GetFinalizerName(driver string) string {
}

// GetNodeIDFromCSINode returns nodeID from CSIDriverInfoSpec
func GetNodeIDFromCSINode(driver string, csiNode *storage.CSINode) (string, bool) {
func GetNodeIDFromCSINode(driver string, csiNode *storagev1beat1.CSINode) (string, bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: storagev1beat1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@jsafrane
Copy link
Contributor

/lgtm
/approve
Thanks a lot for a quick rebase!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 17, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cwdsuzhou, 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 17, 2020
@k8s-ci-robot k8s-ci-robot merged commit 3d81eb3 into kubernetes-csi:master Apr 17, 2020
xing-yang added a commit to xing-yang/external-attacher that referenced this pull request Aug 23, 2022
d24254f6 Merge pull request kubernetes-csi#202 from xing-yang/kind_0.14.0
0faa3fc7 Update to Kind v0.14.0 images
ef4e1b2b Merge pull request kubernetes-csi#201 from xing-yang/add_1.24_image
4ddce251 Add 1.24 Kind image
7fe51491 Merge pull request kubernetes-csi#200 from pohly/bump-kubernetes-version
70915a8e prow.sh: update snapshotter version
31a3f38b Merge pull request kubernetes-csi#199 from pohly/bump-kubernetes-version
7577454a prow.sh: bump Kubernetes to v1.22.0

git-subtree-dir: release-tools
git-subtree-split: d24254f6aa780bb6ba36a946973ee01df5633f6b
@xing-yang xing-yang mentioned this pull request Aug 23, 2022
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/feature Categorizes issue or PR as related to a new feature. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update external-attacher to use v1.VolumeAttachment
5 participants