openbao-helm/test
Christopher Swenson eca526b1ce
Prepare for 0.21.0 release (#771)
Prepare for 0.21.0 release

CHANGES:
* `vault-k8s` updated to 0.17.0. (this)
* `vault-csi-provider` updated to 1.2.0 (this)
* `vault` updated to 1.11.2 (this)
* Start testing against Kubernetes 1.24. [GH-744](https://github.com/hashicorp/vault-helm/pull/744)
* Deprecated `injector.externalVaultAddr`. Added `global.externalVaultAddr`, which applies to both the Injector and the CSI Provider. [GH-745](https://github.com/hashicorp/vault-helm/pull/745)
* CSI Provider pods now set the `VAULT_ADDR` environment variable to either the internal Vault service or the configured external address. [GH-745](https://github.com/hashicorp/vault-helm/pull/745)

Features:
* server: Add `server.statefulSet.securityContext` to override pod and container `securityContext`. [GH-767](https://github.com/hashicorp/vault-helm/pull/767)
* csi: Add `csi.daemonSet.securityContext` to override pod and container `securityContext`. [GH-767](https://github.com/hashicorp/vault-helm/pull/767)
* injector: Add `injector.securityContext` to override pod and container `securityContext`. [GH-750](https://github.com/hashicorp/vault-helm/pull/750) and [GH-767](https://github.com/hashicorp/vault-helm/pull/767)
* Add `server.service.activeNodePort` and `server.service.standbyNodePort` to specify the `nodePort` for active and standby services. [GH-610](https://github.com/hashicorp/vault-helm/pull/610)
* Support for setting annotations on the injector's serviceAccount [GH-753](https://github.com/hashicorp/vault-helm/pull/753)
2022-08-10 14:54:49 -07:00
..
acceptance Prepare for 0.21.0 release (#771) 2022-08-10 14:54:49 -07:00
chart Update chart verifier (#579) 2021-07-29 14:51:35 -07:00
docker Add container based tests documentation (#492) 2021-04-14 13:05:38 -04:00
kind Run CI tests in github workflows (#657) 2021-12-10 17:11:35 -08:00
terraform Updating acceptance tests (#624) 2021-10-11 14:12:55 -07:00
unit csi/server.statefulset: custom security context (#767) 2022-08-08 12:48:28 -07:00
README.md Updating acceptance tests (#624) 2021-10-11 14:12:55 -07:00

Vault Helm Tests

Running Vault Helm Acceptance tests

The Makefile at the top level of this repo contains a few target that should help with running acceptance tests in your own GKE instance or in a kind cluster.

Note that for the Vault Enterprise tests to pass, a VAULT_LICENSE_CI environment variable needs to be set to the contents of a valid Vault Enterprise license.

Running in a GKE cluster

  • Set the GOOGLE_CREDENTIALS and CLOUDSDK_CORE_PROJECT variables at the top of the file. GOOGLE_CREDENTIALS should contain the local path to your Google Cloud Platform account credentials in JSON format. CLOUDSDK_CORE_PROJECT should be set to the ID of your GCP project.
  • Run make test-image to create the docker image (with dependencies installed) that will be re-used in the below steps.
  • Run make test-provision to provision the GKE cluster using terraform.
  • Run make test-acceptance to run the acceptance tests in this already provisioned cluster.
  • You can choose to only run certain tests by setting the ACCEPTANCE_TESTS variable and re-running the above target.
  • Run make test-destroy when you have finished testing and want to tear-down and remove the cluster.

Running in a kind cluster

  • Run make test-acceptance LOCAL_ACCEPTANCE_TESTS=true
  • You can choose to only run certain tests by setting the ACCEPTANCE_TESTS variable and re-running the above target.
  • Run make delete-kind when you have finished testing and want to tear-down and remove the cluster.
  • You can set an alternate kind cluster name by specifying the KIND_CLUSTER_NAME variable for any of the above targets.
  • You can set an alternate K8S version by specifying the KIND_K8S_VERSION variable for any of the above targets.

See kind-quick-start if you don't have kind installed on your system.

Running chart verification tests

If chart-verifier is built and available in your PATH, run:

bats test/chart/verifier.bats

Or if you'd rather use the latest chart-verifier docker container, set USE_DOCKER:

USE_DOCKER=true bats test/chart/verifier.bats

Generating the values json schema

There is a make target for generating values.schema.json:

make values-schema

It relies on the helm schema-gen plugin. Note that some manual editing will be required, since several properties accept multiple data types.

Helm test

Vault Helm also contains a simple helm test under templates/tests/ that may be run against a helm release:

helm test <RELEASE_NAME>