-
Notifications
You must be signed in to change notification settings - Fork 187
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
update volumeAttachment to v1 #200
Conversation
seem we should update the api version of k8s integration test first. |
@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. |
/retest |
logs are about timeout |
ad86ff4
to
ec029c5
Compare
67f481e
to
e457386
Compare
Looks like attacher sidecar successfully updated VA object:
However, controller manager does not seem to see the update:
|
@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. |
Patching fields underneath the status field must be done via the status subresource in v1 |
pkg/controller/csi_handler.go
Outdated
@@ -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) |
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.
if this is changing status fields, it must submit the patch to the status subresource
pkg/controller/csi_handler.go
Outdated
@@ -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) |
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.
pkg/controller/util.go
Outdated
@@ -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) |
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.
pkg/controller/util.go
Outdated
@@ -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) |
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.
e457386
to
a8abecd
Compare
@@ -34,6 +34,9 @@ rules: | |||
- apiGroups: ["storage.k8s.io"] | |||
resources: ["volumeattachments"] | |||
verbs: ["get", "list", "watch", "update", "patch"] | |||
- apiGroups: ["storage.k8s.io"] |
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.
Hm new rbac is going to require us to bump major versions again. @jsafrane are we ready for this?
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 need change e2e test of k8s ?
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 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.
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 created #212 not to forget to bump major version and go module.
I think we can do 3.0 in this cycle.
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.
Thanks
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.
@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.
/hold |
@cwdsuzhou, I think it's time for 3.0 release (together with Kubernetes 1.19). Can you please rebase the PR? |
sure, thanks |
4dd4e4f
to
2797c50
Compare
/hold cc |
/unhold |
lgtm-ish. |
Updated |
pkg/controller/util.go
Outdated
@@ -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) { |
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.
typo: storagev1beat1
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.
done
2797c50
to
9956286
Compare
/lgtm |
[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 |
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
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?:
I am not sure if we need update CSINode to V1