Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix connect pod service account values when launcher is enabled #593

Merged
merged 7 commits into from
Oct 28, 2024
2 changes: 1 addition & 1 deletion charts/rstudio-connect/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: rstudio-connect
description: Official Helm chart for Posit Connect
version: 0.7.11
version: 0.7.12
apiVersion: v2
appVersion: 2024.09.0
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png
Expand Down
4 changes: 4 additions & 0 deletions charts/rstudio-connect/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.7.12

- Fix a bug where `rbac.serviceAccount.name` was not applied when the job launcher is enabled.

## 0.7.11

- Move the values files for linting and installation testing outside the chart directory so that we can iterate on them without releasing a new version of the chart
Expand Down
6 changes: 3 additions & 3 deletions charts/rstudio-connect/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Posit Connect

![Version: 0.7.11](https://img.shields.io/badge/Version-0.7.11-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square)
![Version: 0.7.12](https://img.shields.io/badge/Version-0.7.12-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square)

#### _Official Helm chart for Posit Connect_

Expand Down Expand Up @@ -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.11:
To install the chart with the release name `my-release` at version 0.7.12:

```{.bash}
helm repo add rstudio https://helm.rstudio.com
helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.11
helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.12
```

To explore other chart versions, look at:
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-connect/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
* https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-multiple-service-accounts
*/}}
{{- if and .Values.rbac.create .Values.launcher.enabled }}
{{ $serviceAccountName := default (default .Values.rbac.serviceAccount.name .Values.pod.serviceAccountName) (include "rstudio-connect.fullname" .) }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pod.serviceAccountName is already fully deprecated

» helm template ./ --set pod.serviceAccountName=asdf                  
Error: execution error at (rstudio-connect/templates/NOTES.txt:55:4): 

`pod.serviceAccountName` is no longer used. Use `rbac.serviceAccount.name` instead.

Use --debug flag to render out invalid YAML

{{ $serviceAccountName := default (include "rstudio-connect.fullname" .) .Values.rbac.serviceAccount.name }}
serviceAccountName: {{ $serviceAccountName }}
{{- else }}
serviceAccountName: {{ .Values.rbac.serviceAccount.name | toString | quote }}
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-connect/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- if and (.Values.rbac.create) (.Values.launcher.enabled) }}
{{ $namespace := $.Release.Namespace }}
{{ $targetNamespace := default $.Release.Namespace .Values.launcher.namespace }}
{{ $serviceAccountName := default .Values.rbac.serviceAccount.name (include "rstudio-connect.fullname" .) }}
{{ $serviceAccountName := default (include "rstudio-connect.fullname" .) .Values.rbac.serviceAccount.name }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes of order here are just to ensure that if we have .Values.rbac.serviceAccount.name set, it will override the default of rstudio-connect.fullname?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's exactly right

{{ $serviceAccountCreate := .Values.rbac.serviceAccount.create }}
{{ $serviceAccountAnnotations := .Values.rbac.serviceAccount.annotations }}
{{ $serviceAccountLabels := .Values.rbac.serviceAccount.labels }}
Expand Down
1 change: 1 addition & 0 deletions ci/rstudio-connect/lint/launcher-advanced-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ rbac:
create: true
serviceAccount:
create: true
name: "connect-service-account"
securityContext: null
sharedStorage:
create: true
Expand Down