Skip to content

Commit b70306c

Browse files
authored
fix: optionally take app_id and app_name from secrets for Github (#2009)
1 parent 27d0576 commit b70306c

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

charts/sentry/templates/_helper.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,20 @@ Set github app
10241024
secretKeyRef:
10251025
name: {{ .Values.github.existingSecret }}
10261026
key: {{ default "client-secret" .Values.github.existingSecretClientSecretKey }}
1027+
{{- if .Values.github.existingSecretAppIdKey }}
1028+
- name: GITHUB_APP_ID
1029+
valueFrom:
1030+
secretKeyRef:
1031+
name: {{ .Values.github.existingSecret }}
1032+
key: {{ .Values.github.existingSecretAppIdKey }}
1033+
{{- end }}
1034+
{{- if .Values.github.existingSecretAppNameKey }}
1035+
- name: GITHUB_APP_NAME
1036+
valueFrom:
1037+
secretKeyRef:
1038+
name: {{ .Values.github.existingSecret }}
1039+
key: {{ .Values.github.existingSecretAppNameKey }}
1040+
{{- end }}
10271041
{{- end }}
10281042

10291043
{{/*

charts/sentry/templates/sentry/_helper-sentry.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,12 @@ sentry.conf.py: |-
706706
##########
707707
# Github #
708708
##########
709+
{{- if .Values.github.existingSecretAppIdKey }}
710+
SENTRY_OPTIONS['github-app.id'] = os.environ.get("GITHUB_APP_ID")
711+
{{- end }}
712+
{{- if .Values.github.existingSecretAppNameKey }}
713+
SENTRY_OPTIONS['github-app.name'] = os.environ.get("GITHUB_APP_NAME")
714+
{{- end }}
709715
SENTRY_OPTIONS['github-app.private-key'] = os.environ.get("GITHUB_APP_PRIVATE_KEY")
710716
SENTRY_OPTIONS['github-app.webhook-secret'] = os.environ.get("GITHUB_APP_WEBHOOK_SECRET")
711717
SENTRY_OPTIONS['github-app.client-id'] = os.environ.get("GITHUB_APP_CLIENT_ID")

charts/sentry/values.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2203,13 +2203,17 @@ github: {}
22032203
# Note: if you use `existingSecret`, all above `clientId`, `clientSecret`, `privateKey`, `webhookSecret`
22042204
# params would be ignored, because chart will suppose that they are stored in `existingSecret`. So you
22052205
# must define all required keys and set it at least to empty strings if they are not needed in `existingSecret`
2206-
# secret (client-id, client-secret, webhook-secret, private-key)
2206+
# secret (client-id, client-secret, webhook-secret, private-key).
2207+
# However, `appId` and `appName` will be used from the values above,
2208+
# if `existingSecretAppIdKey` and `existingSecretAppNameKey` are not specified.
22072209
#
22082210
# existingSecret: "xxxxx"
22092211
# existingSecretPrivateKeyKey: "" # by default "private-key"
22102212
# existingSecretWebhookSecretKey: "" # by default "webhook-secret"
22112213
# existingSecretClientIdKey: "" # by default "client-id"
22122214
# existingSecretClientSecretKey: "" # by default "client-secret"
2215+
# existingSecretAppIdKey: "" # if it is specified, it will override .Values.github.appId
2216+
# existingSecretAppNameKey: "" # if it is specified, it will override .Values.github.appName
22132217
#
22142218
# Reference -> https://docs.sentry.io/product/integrations/source-code-mgmt/github/
22152219

0 commit comments

Comments
 (0)