From 2727ec308180cd3f17de2af1de54c6f2e4e8f77f Mon Sep 17 00:00:00 2001 From: Daniel Bodky Date: Mon, 6 May 2024 15:26:51 +0200 Subject: [PATCH 1/2] Update contributor docs --- CONTRIBUTING.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3406efa..84a2820 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,34 @@ Before contributing changes, please take a moment to review open/closed issues a Once the issue has been opened and discussed, you can start working on your changes. Please fork the repository and create a new branch for your changes. Once you are done with your changes, please open a new pull request and reference the issue you created in the description. +### Templating the chart(s) locally + +Charts can be templated locally using `helm template [!NOTE] +> Some values might be required for templating to succeed. +> Simple dummy values are provided in [`charts/icinga-stack/tests/required-values.yaml`](./charts/icinga-stack/tests/required-values.yaml) for all charts. + +```sh +$ cd charts/icinga-stack +$ helm dep update +$ helm template . -f tests/required-values.yaml > icinga-stack-manifests.yaml +$ helm template ./charts/icinga2 -f tests/required-values.yaml > icinga2-manifests.yaml +``` + +### Deploying the chart(s) locally + +Charts can be installed and upgraded locally `helm install .` from their respective root directories: + +> [!NOTE] +> Some values might be required for templating to succeed. +> Simple dummy values are provided in [`charts/icinga-stack/tests/required-values.yaml`](./charts/icinga-stack/tests/required-values.yaml) for all charts. + +```sh +$ helm install . -f tests/required-values.yaml +$ helm update . -f tests/required-values.yaml +``` + ## Testing changes For testing the charts in this repository, we use [helm-unittest](https://github.com/quintush/helm-unittest) and [Docker](https://docker.com). Please refer to the[helm-unittest documentation](https://github.com/quintush/helm-unittest) and [Docker documentation](https://docs.docker.com/get-docker/) for installation instructions. @@ -35,7 +63,7 @@ This will test all the Helm templates in the `./templates/` directory against th To maintain a certain style of tests throughout the charts, please adhere to the following conventions when writing new tests: -* Tests for subcharts should be placed in the `./tests` directory of the parent chart and prefixed with the subchart's name, e.g. `icingaweb2_deployment_test.yaml`. -* Tests should be grouped by the template they are testing. -* Test files should be named after the template they are testing, e.g. Icinga Web's `deployment.yaml` should be tested in `icingaweb2_deployment_test.yaml`. -* **Test Suites** should be prefixed with the name of the product/chart they test, e.g. *[Icinga 2] Test Icinga 2 persistence* +- Tests for subcharts should be placed in the `./tests` directory of the parent chart and prefixed with the subchart's name, e.g. `icingaweb2_deployment_test.yaml`. +- Tests should be grouped by the template they are testing. +- Test files should be named after the template they are testing, e.g. Icinga Web's `deployment.yaml` should be tested in `icingaweb2_deployment_test.yaml`. +- **Test Suites** should be prefixed with the name of the product/chart they test, e.g. _[Icinga 2] Test Icinga 2 persistence_ From a855d386ee354a80a6ec46fec9b5a53420d005c9 Mon Sep 17 00:00:00 2001 From: Daniel Bodky Date: Mon, 6 May 2024 15:27:23 +0200 Subject: [PATCH 2/2] Update .gitignore to ignore downloaded dependencies --- .gitignore | 5 ++++- charts/icinga-stack/Chart.lock | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 charts/icinga-stack/Chart.lock diff --git a/.gitignore b/.gitignore index 7bdc613..b3fbd2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ TODOS.md -__snapshot__/ \ No newline at end of file +__snapshot__/ + +# ignore downloaded dependencies (typically .tar.gz) +charts/icinga-stack/charts/ diff --git a/charts/icinga-stack/Chart.lock b/charts/icinga-stack/Chart.lock new file mode 100644 index 0000000..1fddbfb --- /dev/null +++ b/charts/icinga-stack/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: oci://registry-1.docker.io/bitnamicharts + version: 2.19.2 +digest: sha256:e8815a21c72dd685b5573d0baeeeff733db3bc6d77b30c95a78ff316188e8a65 +generated: "2024-05-06T15:03:37.600822+02:00"