diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 4284095..b84c93b 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -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 -}} diff --git a/templates/gitea/act_runner/job.yaml b/templates/gitea/act_runner/job.yaml index 18ba798..587150f 100644 --- a/templates/gitea/act_runner/job.yaml +++ b/templates/gitea/act_runner/job.yaml @@ -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 diff --git a/templates/gitea/act_runner/statefulset.yaml b/templates/gitea/act_runner/statefulset.yaml index 1149a07..66e724a 100644 --- a/templates/gitea/act_runner/statefulset.yaml +++ b/templates/gitea/act_runner/statefulset.yaml @@ -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: diff --git a/templates/gitea/deployment.yaml b/templates/gitea/deployment.yaml index 9404218..f321f22 100644 --- a/templates/gitea/deployment.yaml +++ b/templates/gitea/deployment.yaml @@ -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 }} diff --git a/values.yaml b/values.yaml index 00cf529..3d2ac2c 100644 --- a/values.yaml +++ b/values.yaml @@ -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: ""