From e6dbe2e83fe9b1b052117a6728ad794b7f862029 Mon Sep 17 00:00:00 2001 From: "Joshua C. Forest" Date: Thu, 14 Nov 2024 14:34:53 -0500 Subject: [PATCH 1/3] Move the tests files locations into the root ci//tests directory --- .github/workflows/chart-test.yaml | 8 +++ charts/rstudio-connect/Chart.yaml | 2 +- charts/rstudio-connect/NEWS.md | 4 ++ .../tests/service-accounts_test.yaml | 0 .../tests/service_accounts_test.yaml | 54 +++++++++++++++++++ 5 files changed, 67 insertions(+), 1 deletion(-) rename {charts => ci}/rstudio-connect/tests/service-accounts_test.yaml (100%) create mode 100644 ci/rstudio-workbench/tests/service_accounts_test.yaml diff --git a/.github/workflows/chart-test.yaml b/.github/workflows/chart-test.yaml index 62d19fe5..2606978f 100644 --- a/.github/workflows/chart-test.yaml +++ b/.github/workflows/chart-test.yaml @@ -98,6 +98,14 @@ jobs: - name: Install helm unittest plugin run: helm plugin install --version v0.6.3 https://github.com/helm-unittest/helm-unittest.git + - name: Symlink ci-tests -> tests + run: | + for dir in ci/*/tests; do + dir=${dir#ci/} + dir=${dir%/tests} + ln -s ../../ci/${dir}/tests charts/${dir}/tests + done + - name: Run chart unit tests id: unittest run: | diff --git a/charts/rstudio-connect/Chart.yaml b/charts/rstudio-connect/Chart.yaml index 76d7444a..376756e9 100644 --- a/charts/rstudio-connect/Chart.yaml +++ b/charts/rstudio-connect/Chart.yaml @@ -1,6 +1,6 @@ name: rstudio-connect description: Official Helm chart for Posit Connect -version: 0.7.15 +version: 0.7.16 apiVersion: v2 appVersion: 2024.11.0 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png diff --git a/charts/rstudio-connect/NEWS.md b/charts/rstudio-connect/NEWS.md index cfa75da0..cea46cd2 100644 --- a/charts/rstudio-connect/NEWS.md +++ b/charts/rstudio-connect/NEWS.md @@ -1,5 +1,9 @@ # Changelog +## 0.7.16 + +- Change location of helm unittests to `ci/rstudio-connect/tests` so changes to unittest files do not require a chart version bump + ## 0.7.15 - Bump Connect version to 2024.11.0 diff --git a/charts/rstudio-connect/tests/service-accounts_test.yaml b/ci/rstudio-connect/tests/service-accounts_test.yaml similarity index 100% rename from charts/rstudio-connect/tests/service-accounts_test.yaml rename to ci/rstudio-connect/tests/service-accounts_test.yaml diff --git a/ci/rstudio-workbench/tests/service_accounts_test.yaml b/ci/rstudio-workbench/tests/service_accounts_test.yaml new file mode 100644 index 00000000..87dc62ef --- /dev/null +++ b/ci/rstudio-workbench/tests/service_accounts_test.yaml @@ -0,0 +1,54 @@ +suite: Workbench Service Accounts +templates: + - configmap-general.yaml + - configmap-prestart.yaml + - configmap-secret.yaml + - configmap-session.yaml + - deployment.yaml +tests: + - it: should set the Workbench pod service account when the launcher is enabled + template: deployment.yaml + set: + launcher: + enabled: true + rbac: + serviceAccount: + name: "workbench-service-account" + asserts: + - equal: + path: "spec.template.spec.serviceAccountName" + value: "workbench-service-account" + - it: should set the Workbench pod service account when the launcher is not enabled + template: deployment.yaml + set: + launcher: + enabled: false + rbac: + serviceAccount: + name: "workbench-service-account" + asserts: + - equal: + path: "spec.template.spec.serviceAccountName" + value: "workbench-service-account" + - it: should use the default serviceAccount name when not set + template: deployment.yaml + asserts: + - equal: + path: "spec.template.spec.serviceAccountName" + value: "RELEASE-NAME-rstudio-workbench" + - it: should use the nameOverride as part of the serviceAccount name when nameOverride is set + template: deployment.yaml + set: + nameOverride: "posit-workbench" + asserts: + - equal: + path: "spec.template.spec.serviceAccountName" + value: "RELEASE-NAME-posit-workbench" + - it: should use the fullnameOverride as the serviceAccount name when fullnameOverride is set + template: deployment.yaml + set: + fullnameOverride: "posit-workbench" + asserts: + - equal: + path: "spec.template.spec.serviceAccountName" + value: "posit-workbench" From 60608657b67da14915147554e27693536ba85797 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 14 Nov 2024 19:38:59 +0000 Subject: [PATCH 2/3] Update helm-docs and README.md --- charts/rstudio-connect/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/rstudio-connect/README.md b/charts/rstudio-connect/README.md index de7a5489..49f11945 100644 --- a/charts/rstudio-connect/README.md +++ b/charts/rstudio-connect/README.md @@ -1,6 +1,6 @@ # Posit Connect -![Version: 0.7.15](https://img.shields.io/badge/Version-0.7.15-informational?style=flat-square) ![AppVersion: 2024.11.0](https://img.shields.io/badge/AppVersion-2024.11.0-informational?style=flat-square) +![Version: 0.7.16](https://img.shields.io/badge/Version-0.7.16-informational?style=flat-square) ![AppVersion: 2024.11.0](https://img.shields.io/badge/AppVersion-2024.11.0-informational?style=flat-square) #### _Official Helm chart for Posit Connect_ @@ -30,11 +30,11 @@ To ensure reproducibility in your environment and insulate yourself from future ## Installing the chart -To install the chart with the release name `my-release` at version 0.7.15: +To install the chart with the release name `my-release` at version 0.7.16: ```{.bash} helm repo add rstudio https://helm.rstudio.com -helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.15 +helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.16 ``` To explore other chart versions, look at: From 84f2c743dc30d078394e4639223b0020fca7868c Mon Sep 17 00:00:00 2001 From: "Joshua C. Forest" Date: Fri, 15 Nov 2024 08:44:23 -0500 Subject: [PATCH 3/3] Add one final serviceaccountname test --- ci/rstudio-workbench/tests/service_accounts_test.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ci/rstudio-workbench/tests/service_accounts_test.yaml b/ci/rstudio-workbench/tests/service_accounts_test.yaml index 87dc62ef..b16a7af5 100644 --- a/ci/rstudio-workbench/tests/service_accounts_test.yaml +++ b/ci/rstudio-workbench/tests/service_accounts_test.yaml @@ -52,3 +52,12 @@ tests: - equal: path: "spec.template.spec.serviceAccountName" value: "posit-workbench" + - it: should use the fullnameOverride as the serviceAccount name when fullnameOverride is set even if nameOverride is set + template: deployment.yaml + set: + fullnameOverride: "posit-workbench" + nameOverride: "old-workbench" + asserts: + - equal: + path: "spec.template.spec.serviceAccountName" + value: "posit-workbench"