rstudio / helm

Helm Resources for RStudio Products
MIT License
36 stars 28 forks source link

[CONNECT] Service account name is not properly set #584

Closed slawekzachcial closed 3 weeks ago

slawekzachcial commented 1 month ago

The chart ignores the service account name provided in chart values and is always set to the result of rstudio-connect.fullname template.

The following line seems to be incorrect: https://github.com/rstudio/helm/blob/f7bf50ca6a29a455122e75edf47fd5102fddb16b/charts/rstudio-connect/templates/rbac.yaml#L4

Based on the Helm documentation for default function, its syntax is default DEFAULT_VALUE GIVEN_VALUE.

Therefore to take properly into account the service account name specified in Values, the line above should rather be:

{{ $serviceAccountName := default (include "rstudio-connect.fullname" .) .Values.rbac.serviceAccount.name }}

Similar issue is present here: https://github.com/rstudio/helm/blob/f7bf50ca6a29a455122e75edf47fd5102fddb16b/charts/rstudio-connect/templates/deployment.yaml#L80

dbkegley commented 1 month ago

Thank you for filing this! I'll take a look today and get this resolved. Confirmed that the service account cannot be set.

Note that this is only true when the launcher is enabled:

» helm template ./ --set launcher.enabled=true --set rbac.serviceAccount.name=asdf --set sharedStorage.create=true | grep serviceAccount
   ...
      serviceAccountName: release-name-rstudio-connect

vs w/o the launcher we get the correct behavior

» helm template ./ --set rbac.serviceAccount.name=asdf | grep serviceAccount 
      serviceAccountName: "asdf"