rstudio / helm

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

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

Closed dbkegley closed 3 weeks ago

dbkegley commented 1 month ago

Fixes #584

The connect pod service account values were being incorrectly applied when the job launcher is enabled. This PR fixes the Connect pod's serviceAccount value and removes some dead code.

Before:

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

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

After:

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

# w/ launcher
» helm template ./ --set launcher.enabled=true --set sharedStorage.create=true --set rbac.serviceAccount.name=asdf | grep serviceAccount
...
      serviceAccountName: asdf
zackverham commented 1 month ago

Not immediately related to your PR itself - but it does feel like something in CI should have caught this, yeah?

jforest commented 1 month ago

Not immediately related to your PR itself - but it does feel like something in CI should have caught this, yeah?

There are not many ct install tests yet for each product, so we would not have had any way to catch this yet. Hopefully @dbkegley and others can help with creating the values files needed in ci/<product_name>/install/<testname>-values.yaml as we continue. We are working on it though!

dbkegley commented 1 month ago

@jforest I'm not very familiar with chart-testing but do you know if it would allow us to provide assertions for expected output? This bug for example would have produced a "valid" installation but would have used the wrong service account for the Connect pod. I'm happy to help look into this more myself as well, just wondering if you know off hand

jforest commented 1 month ago

@jforest I'm not very familiar with chart-testing but do you know if it would allow us to provide assertions for expected output? This bug for example would have produced a "valid" installation but would have used the wrong service account for the Connect pod. I'm happy to help look into this more myself as well, just wondering if you know off hand

I don't think so, I believe you can create a values file (ending in -values.yaml) and run an install with those values files.

Could you merge main into this branch please? It should fix the linting error

dbkegley commented 1 month ago

I don't think so, I believe you can create a values file (ending in -values.yaml) and run an install with those values files.

That makes sense, seems like we have the install half but are missing the assertions. I believe we just need to write some tests that live in the charts/rstudio-connect/templates/test directory and it sounds like they will get evaluated automatically by each ct install

https://helm.sh/docs/topics/chart_tests/ https://github.com/helm/chart-testing/blob/main/doc/ct_install.md#synopsis

cc @plascaray

Could you merge main into this branch please? It should fix the linting error

Done!

dbkegley commented 3 weeks ago

@jforest would you mind taking another look at this CI failure? I pulled from main and the branch seems to have passed all the linting but it's failing to add the linting results to the PR with the following error:

SyntaxError: Unexpected identifier 'pod'

jforest commented 3 weeks ago

@jforest would you mind taking another look at this CI failure? I pulled from main and the branch seems to have passed all the linting but it's failing to add the linting results to the PR with the following error:

SyntaxError: Unexpected identifier 'pod'

Yah, I've got a test PR trying to fix this, I think I'm just going to pull out trying to post the output to the PR, it's causing more trouble than it's worth. People can just check the GHA output directly

I'll let you know when I've gotten that merged to main so you can merge main again

jforest commented 3 weeks ago

@dbkegley I have merged https://github.com/rstudio/helm/pull/597, you should merge main into your branch!

dbkegley commented 3 weeks ago

Thanks @jforest ! It's working now, would you mind reviewing/approving for infraops so we can get this fix released?