-
Notifications
You must be signed in to change notification settings - Fork 24
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a different implementation would be rendering serviceAccountName: default
whenever .serviceAccount.create=true
and .serviceAccount.name!="
They work the same tho
@@ -41,7 +41,16 @@ Create the name of the service account to use | |||
{{- define "sourcegraph.serviceAccountName" -}} | |||
{{- $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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.yaml
Enable SA
Updated
override.yaml
fix https://github.com/sourcegraph/sourcegraph/issues/31889