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

Enable snapshot e2e test for csi pd driver #85169

Merged

Conversation

boylee1111
Copy link
Contributor

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?:

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 13, 2019
@k8s-ci-robot
Copy link
Contributor

Welcome @boylee1111!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/test sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 13, 2019
@yuxiangqian
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 14, 2019
@yuxiangqian
Copy link
Contributor

cc @xing-yang @msau42

@@ -11,6 +11,9 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-gce-pd-provisioner-role
rules:
- apiGroups: [""]
Copy link
Member

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

Copy link
Contributor Author

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"]
Copy link
Member

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

Copy link
Contributor Author

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"]
Copy link
Member

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

Copy link
Member

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

Copy link
Contributor

@xing-yang xing-yang Nov 14, 2019

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"]
Copy link
Member

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

Copy link
Contributor

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.

Copy link
Member

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
Copy link
Member

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?

Copy link
Contributor Author

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
Copy link
Member

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

Copy link
Contributor

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

Copy link
Contributor Author

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
@boylee1111 boylee1111 force-pushed the enable_snapshot_e2e_test_for_pd branch from b94b247 to 3a7d032 Compare November 14, 2019 18:57
@boylee1111 boylee1111 force-pushed the enable_snapshot_e2e_test_for_pd branch from 3a7d032 to 9b95628 Compare November 14, 2019 19:11
@@ -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")
Copy link
Contributor

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.

Copy link
Member

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.

@msau42
Copy link
Member

msau42 commented Nov 14, 2019

/lgtm
/approve

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

[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 /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 Nov 14, 2019
@boylee1111 boylee1111 changed the title WIP: Enable snapshot e2e test for csi pd driver Enable snapshot e2e test for csi pd driver Nov 14, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 14, 2019
@k8s-ci-robot k8s-ci-robot merged commit 693db6e into kubernetes:master Nov 15, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Nov 15, 2019
@msau42
Copy link
Member

msau42 commented Nov 15, 2019

This new test is failing in the alpha CI job, so we are reverting this PR:
https://prow.k8s.io/view/gcs/kubernetes-jenkins/logs/ci-kubernetes-e2e-gci-gce-alpha-features/1195171726233702402

@boylee1111 boylee1111 deleted the enable_snapshot_e2e_test_for_pd branch November 15, 2019 21:29
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. area/test 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable snapshot tests for pd csi driver
5 participants