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
Enable snapshot e2e test for csi pd driver #85169
Enable snapshot e2e test for csi pd driver #85169
Conversation
Welcome @boylee1111! |
Hi @boylee1111. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions 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. |
/ok-to-test |
@@ -11,6 +11,9 @@ apiVersion: rbac.authorization.k8s.io/v1 | |||
metadata: | |||
name: csi-gce-pd-provisioner-role | |||
rules: | |||
- apiGroups: [""] |
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.
PD csi driver shouldn't need secrets access
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.
removed
resources: ["events"] | ||
verbs: ["list", "watch", "create", "update", "patch"] | ||
- apiGroups: [""] | ||
resources: ["secrets"] |
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.
shouldn't need secrets access
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.
removed
verbs: ["get", "list", "watch"] | ||
- apiGroups: ["snapshot.storage.k8s.io"] | ||
resources: ["volumesnapshotcontents"] | ||
verbs: ["create", "get", "list", "watch", "update", "delete"] |
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.
do we need create/update permission? I thought snapshot controller is supposed to do that? Also who is supposed to handle delete? cc @xing-yang
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.
Also add patch. I think patch is preferred over update
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.
Actually we should not need "create" as the common snapshot controller will be creating the content.
Sidecar is responsible for removing content finalizer and deleting content so we do need "update" and "delete" here.
verbs: ["create", "get", "list", "watch", "update", "delete"] | ||
- apiGroups: ["snapshot.storage.k8s.io"] | ||
resources: ["volumesnapshotcontents/status"] | ||
verbs: ["update"] |
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.
also add patch too. I think in general, patch is preferred over update
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.
How is patch different from update? I see in API call, it is usually "update" that gets called.
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.
Patch is the preferred way to update api objects. It generally results in fewer failed API updates because you don't need the entire object to be the same if all you want to do is update a single field. We recently changed external-attacher to use patch instead of update. We should consider changing snapshotter to do the same while we're making breaking changes :-)
@@ -39,11 +48,12 @@ metadata: | |||
subjects: | |||
- kind: ServiceAccount | |||
name: csi-gce-pd-controller-sa | |||
namespace: default |
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.
Is this right? I thought the csi driver gets deployed in the e2e test namespace?
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.
removed namespace, namespace will be patched before deployment
imagePullPolicy: Always | ||
volumeMounts: | ||
- name: socket-dir | ||
mountPath: /csi | ||
- name: csi-provisioner | ||
image: gcr.io/gke-release/csi-provisioner:v1.4.0-gke.0 |
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 believe provisioner also has to be updated too? cc @xing-yang
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.
Yes. Use quay.io/k8scsi/csi-provisioner:v1.5.0-rc1
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.
updated. thx
- add pd driver manifests - modify snapshottable test case
b94b247
to
3a7d032
Compare
3a7d032
to
9b95628
Compare
@@ -146,6 +147,12 @@ func (s *snapshottableTestSuite) defineTests(driver TestDriver, pattern testpatt | |||
framework.Failf("Error deleting claim %q. Error: %v", pvc.Name, err) | |||
} | |||
}() | |||
|
|||
ginkgo.By("starting a pod") |
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.
@msau42
Spoke with @boylee1111 w.r.t this piece. For PD CSI driver, it returns a storage class with delay binding and thus the need to create a pod.
As this is really to test snapshot functionality, IMHO it could be beneficial to remove this constraint.
Thought this PR is just to enable PD CSI driver e2e testing for snapshot, we could leave it here for now and think about removing it later when more test cases are added.
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 think it is fine to keep it. This test suite should work against any storageclass, with or without delayed binding.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: boylee1111, msau42 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 |
This new test is failing in the alpha CI job, so we are reverting this PR: |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR enables the snapshot e2e testing for csi pd driver
Which issue(s) this PR fixes:
Fixes #81318
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: