diff --git a/README.md b/README.md index d7a6e85ea..d67626902 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ The following table captures the compatibility matrix of the core persistent dis | dev | yes | The manifest bundle which captures all the driver components (driver pod which includes the containers csi-provisioner, csi-resizer, csi-snapshotter, gce-pd-driver, csi-driver-registrar; -csi driver object, rbacs, pod security policies etc) can be picked up from the master branch [overlays](deploy/kubernetes/overlays) directory. We structure the overlays directory, per minor version of kubernetes because not all driver components can be used with all kubernetes versions. +csi driver object, rbacs, pod security policies etc) can be picked up from the master branch [overlays](deploy/kubernetes/overlays) directory. We structure the overlays directory, per minor version of kubernetes because not all driver components can be used with all kubernetes versions. Example: @@ -97,7 +97,7 @@ Controller-level and node-level deployments will both have priorityClassName set ## Further Documentation -[Local Development](docs/local-development.md) +[Local Development](docs/kubernetes/development.md) For releasing new versions of this driver, googlers should consult [go/pdcsi-oss-release-process](go/pdcsi-oss-release-process). diff --git a/deploy/common.sh b/deploy/common.sh index faab78994..ad1705640 100644 --- a/deploy/common.sh +++ b/deploy/common.sh @@ -19,7 +19,7 @@ function ensure_var(){ function get_needed_roles() { - echo "roles/compute.storageAdmin roles/iam.serviceAccountUser projects/${PROJECT}/roles/gcp_compute_persistent_disk_csi_driver_custom_role" + echo "roles/editor roles/compute.storageAdmin roles/iam.serviceAccountUser projects/${PROJECT}/roles/gcp_compute_persistent_disk_csi_driver_custom_role" } # Installs kustomize in ${PKGDIR}/bin diff --git a/docs/kubernetes/development.md b/docs/kubernetes/development.md index 6cdc19fcb..4cee91169 100644 --- a/docs/kubernetes/development.md +++ b/docs/kubernetes/development.md @@ -18,6 +18,50 @@ To bring down driver: ``` $ ./deploy/kubernetes/delete-driver.sh ``` +## Testing + +### E2E Tests: + +#### One time setup + +```console +$ export PROJECT=my-project # GCP Project to run tests in +$ export GCE_PD_SA_NAME=$PROJECT-pd-sa # Name of the service account to create +$ export GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to save the service account key +$ export ENABLE_KMS=false +$ ./deploy/setup-project.sh +``` +#### Ongoing runs +```console +$ export PROJECT=my-project # GCP Project to run tests in +$ export GCE_PD_SA_NAME=$PROJECT-pd-sa +$ export IAM_NAME=$GCE_PD_SA_NAME@$PROJECT.iam.gserviceaccount.com # IAM SA that was set up in "one time setup" + +$ ./test/run-e2e-local.sh +``` + +### Sanity Tests +> **_NOTE:_** Sanity tests are currently failing, tracked by https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/issues/990. + +Sanity tests can be run from VS Code, etc directly or via the cmd line: +``` +$ ./test/run-sanity.sh +``` + +### Unit Tests +Unit tests can be run from VS Code, etc directly or via the cmd line: +``` +$ ./test/run-unit.sh +``` + +## Dependency Management + +Use [dep](https://github.com/golang/dep) +``` +$ dep ensure +``` + +To modify dependencies or versions change `./Gopkg.toml` ## Debugging diff --git a/docs/local-development.md b/docs/local-development.md deleted file mode 100644 index f9984e893..000000000 --- a/docs/local-development.md +++ /dev/null @@ -1,30 +0,0 @@ -# Local development -This page contains information on how to develop and test the driver locally. - -## Testing - -Running E2E Tests: -``` -$ PROJECT=my-project # GCP Project to run tests in -$ IAM_NAME=my-iam@project.iam.gserviceaccount.com # Existing IAM Account with GCE PD CSI Driver Permissions -$ ./test/run-e2e-local.sh -``` - -Running Sanity Tests: -``` -$ ./test/run-sanity.sh -``` - -Running Unit Tests: -``` -$ ./test/run-unit.sh -``` - -## Dependency Management - -Use [dep](https://github.com/golang/dep) -``` -$ dep ensure -``` - -To modify dependencies or versions change `./Gopkg.toml`