From ee61d4a7173a1a9dda858abed83e7f9c6575a852 Mon Sep 17 00:00:00 2001 From: Julianne DeMars Date: Wed, 16 Nov 2022 22:56:03 +0000 Subject: [PATCH 1/4] update local development instructions --- deploy/common.sh | 2 +- docs/local-development.md | 29 +++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 7 deletions(-) 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/local-development.md b/docs/local-development.md index f9984e893..882246193 100644 --- a/docs/local-development.md +++ b/docs/local-development.md @@ -3,19 +3,36 @@ 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 +### 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 ``` -Running Sanity Tests: +### Sanity Tests +> **_NOTE:_** Sanity tests are currently failing, tracked by go/pdcsi-oss-driver/issues/990. + +Unit tests can be run from VS Code, etc directly or via the cmd line: ``` $ ./test/run-sanity.sh ``` -Running Unit Tests: +### Unit Tests +Unit tests can be run from VS Code, etc directly or via the cmd line: ``` $ ./test/run-unit.sh ``` From 2681dbac7c74d57b3d8d75796e82cff07cbfb84b Mon Sep 17 00:00:00 2001 From: Julianne DeMars Date: Wed, 16 Nov 2022 23:43:06 +0000 Subject: [PATCH 2/4] fix word --- docs/local-development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/local-development.md b/docs/local-development.md index 882246193..eb5e1f036 100644 --- a/docs/local-development.md +++ b/docs/local-development.md @@ -26,7 +26,7 @@ $ ./test/run-e2e-local.sh ### Sanity Tests > **_NOTE:_** Sanity tests are currently failing, tracked by go/pdcsi-oss-driver/issues/990. -Unit tests can be run from VS Code, etc directly or via the cmd line: +Sanity tests can be run from VS Code, etc directly or via the cmd line: ``` $ ./test/run-sanity.sh ``` From 5507e70404d48cae77de43db042c149b5f9c97f2 Mon Sep 17 00:00:00 2001 From: Julianne DeMars Date: Thu, 17 Nov 2022 19:35:40 +0000 Subject: [PATCH 3/4] removing go link --- docs/local-development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/local-development.md b/docs/local-development.md index eb5e1f036..33187208c 100644 --- a/docs/local-development.md +++ b/docs/local-development.md @@ -24,7 +24,7 @@ $ ./test/run-e2e-local.sh ``` ### Sanity Tests -> **_NOTE:_** Sanity tests are currently failing, tracked by go/pdcsi-oss-driver/issues/990. +> **_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: ``` From 5a91ae16259621921a7e2c9724895230a3d7eb77 Mon Sep 17 00:00:00 2001 From: Julianne DeMars Date: Thu, 17 Nov 2022 19:43:42 +0000 Subject: [PATCH 4/4] combine local development guides --- README.md | 4 +-- docs/kubernetes/development.md | 44 +++++++++++++++++++++++++++++++ docs/local-development.md | 47 ---------------------------------- 3 files changed, 46 insertions(+), 49 deletions(-) delete mode 100644 docs/local-development.md 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/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 33187208c..000000000 --- a/docs/local-development.md +++ /dev/null @@ -1,47 +0,0 @@ -# Local development -This page contains information on how to develop and test the driver locally. - -## 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`