-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mobu: Split GitHub refresh and CI app config
* Separate config dicts in Values * Separate anonymous ingresses for each app * Separate ConfigMaps for each app
- Loading branch information
Showing
17 changed files
with
252 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if .Values.config.githubCiApp -}} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "mobu.fullname" . }}-github-ci-app | ||
labels: | ||
{{- include "mobu.labels" . | nindent 4 }} | ||
data: | ||
github-ci-app.yaml: | | ||
{{- toYaml .Values.config.githubCiApp | nindent 4 }} | ||
{{- end }} |
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
applications/mobu/templates/configmap-github-refresh-app.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if .Values.config.githubRefreshApp -}} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "mobu.fullname" . }}-github-refresh-app | ||
labels: | ||
{{- include "mobu.labels" . | nindent 4 }} | ||
data: | ||
github-refresh-app.yaml: | | ||
{{- toYaml .Values.config.githubRefreshApp | nindent 4 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
applications/mobu/templates/ingress-github-refresh-app.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{- if .Values.config.githubRefreshApp }} | ||
apiVersion: gafaelfawr.lsst.io/v1alpha1 | ||
kind: GafaelfawrIngress | ||
metadata: | ||
name: {{ template "mobu.fullname" . }}-github-refresh | ||
labels: | ||
{{- include "mobu.labels" . | nindent 4 }} | ||
config: | ||
baseUrl: {{ .Values.global.baseUrl | quote }} | ||
scopes: | ||
anonymous: true | ||
template: | ||
metadata: | ||
name: {{ template "mobu.fullname" . }}-github-refresh | ||
{{- with .Values.ingress.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 6 }} | ||
{{- end }} | ||
spec: | ||
rules: | ||
- host: {{ required "global.host must be set" .Values.global.host | quote }} | ||
http: | ||
paths: | ||
- path: "{{ .Values.config.pathPrefix }}/github/refresh" | ||
pathType: "Prefix" | ||
backend: | ||
service: | ||
name: {{ template "mobu.fullname" . }} | ||
port: | ||
number: 8080 | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
suite: Github CI App Integration Enabled | ||
set: | ||
config: | ||
githubCiApp: | ||
accepted_github_orgs: | ||
- "org1" | ||
- "org2" | ||
users: | ||
- "bot-mobu-ci-user-1" | ||
- "bot-mobu-ci-user-2" | ||
scopes: | ||
- "exec:notebook" | ||
- "read:tap" | ||
global: | ||
host: "example.com" | ||
tests: | ||
- it: "Should create an anonymous ingress" | ||
template: "ingress-github-ci-app.yaml" | ||
asserts: | ||
- containsDocument: | ||
kind: "GafaelfawrIngress" | ||
apiVersion: gafaelfawr.lsst.io/v1alpha1 | ||
- equal: | ||
path: "config.scopes.anonymous" | ||
value: true | ||
|
||
- it: "Should inject secrets into the Deployment env" | ||
template: "deployment.yaml" | ||
asserts: | ||
- contains: | ||
path: "spec.template.spec.containers[0].env" | ||
any: true | ||
content: | ||
name: "MOBU_GITHUB_CI_APP_CONFIG_PATH" | ||
- contains: | ||
path: "spec.template.spec.containers[0].env" | ||
any: true | ||
content: | ||
name: "MOBU_GITHUB_CI_APP_ID" | ||
- contains: | ||
path: "spec.template.spec.containers[0].env" | ||
any: true | ||
content: | ||
name: "MOBU_GITHUB_CI_APP_PRIVATE_KEY" | ||
- contains: | ||
path: "spec.template.spec.containers[0].env" | ||
any: true | ||
content: | ||
name: "MOBU_GITHUB_CI_APP_WEBHOOK_SECRET" | ||
- it: "Should create a ConfigMap" | ||
template: "configmap-github-ci-app.yaml" | ||
asserts: | ||
- containsDocument: | ||
kind: "ConfigMap" | ||
apiVersion: v1 | ||
- equal: | ||
path: "data['github-ci-app.yaml']" | ||
value: | | ||
accepted_github_orgs: | ||
- org1 | ||
- org2 | ||
scopes: | ||
- exec:notebook | ||
- read:tap | ||
users: | ||
- bot-mobu-ci-user-1 | ||
- bot-mobu-ci-user-2 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.