Support custom service account name#52
Conversation
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
| {{- $defaultServiceAccountName := ((snakecase $service) | replace "_" "-") }} | ||
| {{- default $defaultServiceAccountName (index $top.Values $service "serviceAccount" "name") }} | ||
| {{- end }} | ||
|
|
||
| {{- define "sourcegraph.renderServiceAccountName" -}} | ||
| {{- $top := index . 0 }} | ||
| {{- $service := index . 1 }} | ||
| {{- if or (index $top.Values $service "serviceAccount" "create") (index $top.Values $service "serviceAccount" "name") }} | ||
| serviceAccountName: {{ include "sourcegraph.serviceAccountName" (list $top $service) }} | ||
| {{- end }} |
There was a problem hiding this comment.
a different implementation would be rendering serviceAccountName: default whenever .serviceAccount.create=true and .serviceAccount.name!="
They work the same tho
| {{- $top := index . 0 }} | ||
| {{- $service := index . 1 }} | ||
| {{- default $service (index $top.Values $service "serviceAccount" "name") }} | ||
| {{- $defaultServiceAccountName := ((snakecase $service) | replace "_" "-") }} |
There was a problem hiding this comment.
I think the convention of resource name is dashed instead of camelCase
this line does the following
camelCase -> snake_case -> replace("_", "-")
repoUpdater -> repo_updater -> repo-updater
codeInsightsDb -> code_insights_db -> code-insights-db
in this case, ideally we want codeinsights-db to be consistent with the deployment name, but the top-level key in values.yaml is codeInsightsDB instead of `codeinsightsDB.
7fa74f9 to
fcf2721
Compare
3929944 to
bdddee6
Compare
fcf2721 to
6b435c7
Compare
bdddee6 to
26210d7
Compare
1844b85 to
af95c21
Compare
26210d7 to
1366f4b
Compare
bdc40a3 to
f878f46
Compare
1366f4b to
09f629a
Compare
f878f46 to
4cd6dd7
Compare
|
Graphite Merge Job Current status: ✅ Merged This pull request was successfully merged as part of a stack. This comment was auto-generated by Graphite. Job Reference: yNqXdfNl9dvIL5h0XluD |
4cd6dd7 to
86b0fd9
Compare

This PR enables users to override service account for all deployed resources
Test plan
Initial deployment
override.yamlEnable SA
Updated
override.yamlfix https://github.com/sourcegraph/sourcegraph/issues/31889