remove unnecessary environment variables

allow for image to be edited via values file
allow for ttl of job to be edited via values files
This commit is contained in:
Vince Montalbano 2024-07-23 14:52:39 -05:00
parent 64e8e4f802
commit d30ac63d7b
5 changed files with 19 additions and 43 deletions

View File

@ -333,14 +333,8 @@ https
{{- if not .Values.gitea.config.indexer.ISSUE_INDEXER_TYPE -}}
{{- $_ := set .Values.gitea.config.indexer "ISSUE_INDEXER_TYPE" "db" -}}
{{- end -}}
{{- if not .Values.gitea.config.actions.GITEA__ACTIONS__ENABLED -}}
{{- $_ := set .Values.gitea.config.actions "GITEA__ACTIONS__ENABLED" "true" -}}
{{- end -}}
{{- if not .Values.gitea.config.actions.GITEA__SERVER__LOCAL_ROOT_URL -}}
{{- $_ := set .Values.gitea.config.actions "GITEA__SERVER__LOCAL_ROOT_URL" (printf "http://%s-http:%.0f" (include "gitea.fullname" .) .Values.service.http.port) -}}
{{- end -}}
{{- if not .Values.gitea.config.actions.GITEA__INSTANCE__URL -}}
{{- $_ := set .Values.gitea.config.actions "GITEA__INSTANCE__URL" (printf "http://%s-http:%.0f" (include "gitea.fullname" .) .Values.service.http.port) -}}
{{- if not .Values.gitea.config.actions.ENABLED -}}
{{- $_ := set .Values.gitea.config.actions "ENABLED" "false" -}}
{{- end -}}
{{- end -}}
@ -361,6 +355,9 @@ https
{{- if not .Values.gitea.config.server.ROOT_URL -}}
{{- $_ := set .Values.gitea.config.server "ROOT_URL" (printf "%s://%s" (include "gitea.public_protocol" .) .Values.gitea.config.server.DOMAIN) -}}
{{- end -}}
{{- if not .Values.gitea.config.server.LOCAL_ROOT_URL -}}
{{- $_ := set .Values.gitea.config.server "LOCAL_ROOT_URL" (printf "http://%s-http:%.0f" (include "gitea.fullname" .) .Values.service.http.port) -}}
{{- end -}}
{{- if not .Values.gitea.config.server.SSH_DOMAIN -}}
{{- $_ := set .Values.gitea.config.server "SSH_DOMAIN" .Values.gitea.config.server.DOMAIN -}}
{{- end -}}

View File

@ -20,7 +20,7 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ttlSecondsAfterFinished: 300
ttlSecondsAfterFinished: {{ .Values.actions.provisioning.ttlSecondsAfterFinished }}
template:
metadata:
labels:
@ -32,7 +32,7 @@ spec:
spec:
initContainers:
- name: init-gitea
image: busybox:1.36.1
image: "{{ .Values.actions.init.repository }}:{{ .Values.actions.init.tag }}"
command:
- sh
- -c
@ -42,8 +42,8 @@ spec:
done
containers:
- name: actions-token-create
image: "{{ .Values.actions.provisioning.token.repository }}:{{ .Values.actions.provisioning.token.tag | default (printf "%s-rootless" .Chart.AppVersion) }}"
imagePullPolicy: {{ .Values.actions.provisioning.token.pullPolicy }}
image: "{{ include "gitea.image" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: GITEA_APP_INI
value: /data/gitea/conf/app.ini

View File

@ -28,7 +28,7 @@ spec:
spec:
initContainers:
- name: init-gitea
image: busybox:1.36.1
image: "{{ .Values.actions.init.repository }}:{{ .Values.actions.init.tag }}"
command:
- sh
- -c
@ -54,7 +54,7 @@ spec:
name: "{{ .Values.actions.existingSecret | default $secretName }}"
key: "{{ .Values.actions.existingSecretKey | default "token" }}"
- name: GITEA_INSTANCE_URL
value: "http://{{ include "gitea.fullname" . }}-http:{{ .Values.service.http.port }}"
value: {{ .Values.gitea.config.server.LOCAL_ROOT_URL | quote }}
- name: CONFIG_FILE
value: /actrunner/config.yaml
resources:

View File

@ -71,12 +71,6 @@ spec:
value: /data
- name: GITEA_TEMP
value: /tmp/gitea
{{- if .Values.actions.enabled }}
- name: GITEA__ACTIONS__ENABLED
value: {{ .Values.gitea.config.actions.GITEA__ACTIONS__ENABLED | quote }}
- name: GITEA__SERVER__LOCAL_ROOT_URL
value: {{ .Values.gitea.config.actions.GITEA__SERVER__LOCAL_ROOT_URL | quote }}
{{- end }}
{{- if .Values.deployment.env }}
{{- toYaml .Values.deployment.env | nindent 12 }}
{{- end }}
@ -112,12 +106,6 @@ spec:
value: /data
- name: GITEA_TEMP
value: /tmp/gitea
{{- if .Values.actions.enabled }}
- name: GITEA__ACTIONS__ENABLED
value: {{ .Values.gitea.config.actions.GITEA__ACTIONS__ENABLED | quote }}
- name: GITEA__SERVER__LOCAL_ROOT_URL
value: {{ .Values.gitea.config.actions.GITEA__SERVER__LOCAL_ROOT_URL | quote }}
{{- end }}
{{- if .Values.deployment.env }}
{{- toYaml .Values.deployment.env | nindent 12 }}
{{- end }}
@ -257,12 +245,6 @@ spec:
{{- end }}
- name: GITEA_ADMIN_PASSWORD_MODE
value: {{ include "gitea.admin.passwordMode" $ }}
{{- if .Values.actions.enabled }}
- name: GITEA__ACTIONS__ENABLED
value: {{ .Values.gitea.config.actions.GITEA__ACTIONS__ENABLED | quote }}
- name: GITEA__SERVER__LOCAL_ROOT_URL
value: {{ .Values.gitea.config.actions.GITEA__SERVER__LOCAL_ROOT_URL | quote }}
{{- end }}
{{- if .Values.deployment.env }}
{{- toYaml .Values.deployment.env | nindent 12 }}
{{- end }}
@ -312,12 +294,6 @@ spec:
- name: GNUPGHOME
value: {{ .Values.signing.gpgHome }}
{{- end }}
{{- if .Values.actions.enabled }}
- name: GITEA__ACTIONS__ENABLED
value: {{ .Values.gitea.config.actions.GITEA__ACTIONS__ENABLED | quote }}
- name: GITEA__SERVER__LOCAL_ROOT_URL
value: {{ .Values.gitea.config.actions.GITEA__SERVER__LOCAL_ROOT_URL | quote }}
{{- end }}
{{- if .Values.deployment.env }}
{{- toYaml .Values.deployment.env | nindent 12 }}
{{- end }}

View File

@ -401,6 +401,12 @@ actions:
tag: 25.0.2-dind
pullPolicy: IfNotPresent
init:
image:
repository: busybox
# Overrides the image tag whose default is the chart appVersion.
tag: "1.36.1"
provisioning:
enabled: false
@ -411,16 +417,13 @@ actions:
tolerations: []
affinity: {}
token:
repository: gitea/gitea
tag: ""
pullPolicy: IfNotPresent
publish:
repository: bitnami/kubectl
tag: 1.29.0
pullPolicy: IfNotPresent
ttlSecondsAfterFinished: 300
## Specify an existing token secret
##
existingSecret: ""