Commit 48b10735 authored by DJ Mountney's avatar DJ Mountney

Merge branch '1258-external-diffs-when' into 'master'

Support the 'when' setting for external diffs

Closes #1258

See merge request charts/gitlab!743
parents 2d2675fe 15bfa4dc
Pipeline #55818003 passed with stages
in 43 minutes and 35 seconds
---
title: Add support for when setting for external diffs
merge_request: 743
author:
type: added
......@@ -68,11 +68,11 @@ data:
{{- include "gitlab.appConfig.cronJobs" . | nindent 6 }}
{{ include "gitlab.appConfig.extra" . | indent 6 }}
{{- end }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "artifacts" "config" $.Values.global.appConfig.artifacts "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "lfs" "config" $.Values.global.appConfig.lfs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "uploads" "config" $.Values.global.appConfig.uploads "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "packages" "config" $.Values.global.appConfig.packages "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "external_diffs" "config" $.Values.global.appConfig.externalDiffs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.artifacts.configuration" (dict "config" $.Values.global.appConfig.artifacts "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.lfs.configuration" (dict "config" $.Values.global.appConfig.lfs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.uploads.configuration" (dict "config" $.Values.global.appConfig.uploads "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.packages.configuration" (dict "config" $.Values.global.appConfig.packages "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.external_diffs.configuration" (dict "config" $.Values.global.appConfig.externalDiffs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.pseudonymizer.configuration" $ | nindent 6 }}
pages:
enabled: false
......
......@@ -91,6 +91,7 @@ global:
bucket:
connection: {}
externalDiffs:
when:
proxy_download: true
bucket:
connection: {}
......
......@@ -44,9 +44,9 @@ data:
{{- end }}
artifacts:
enabled: true
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "lfs" "config" $.Values.global.appConfig.lfs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "packages" "config" $.Values.global.appConfig.packages "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "external_diffs" "config" $.Values.global.appConfig.externalDiffs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.lfs.configuration" (dict "config" $.Values.global.appConfig.lfs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.packages.configuration" (dict "config" $.Values.global.appConfig.packages "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.external_diffs.configuration" (dict "config" $.Values.global.appConfig.externalDiffs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.pseudonymizer.configuration" $ | nindent 6 }}
pages:
enabled: false
......
......@@ -55,6 +55,7 @@ global:
bucket:
connection: {}
externalDiffs:
when:
proxy_download: true
bucket:
connection: {}
......
......@@ -97,11 +97,11 @@ data:
ssl_url: {{ .gravatar.sslUrl }}
{{ include "gitlab.appConfig.extra" . | indent 6 }}
{{- end }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "artifacts" "config" $.Values.global.appConfig.artifacts "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "lfs" "config" $.Values.global.appConfig.lfs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "uploads" "config" $.Values.global.appConfig.uploads "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "packages" "config" $.Values.global.appConfig.packages "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "external_diffs" "config" $.Values.global.appConfig.externalDiffs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.artifacts.configuration" (dict "config" $.Values.global.appConfig.artifacts "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.lfs.configuration" (dict "config" $.Values.global.appConfig.lfs "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.uploads.configuration" (dict "config" $.Values.global.appConfig.uploads "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.packages.configuration" (dict "config" $.Values.global.appConfig.packages "context" $) | nindent 6 }}
{{- include "gitlab.appConfig.external_diffs.configuration" (dict "config" $.Values.global.appConfig.externalDiffs "context" $) | nindent 6 }}
pages:
enabled: false
mattermost:
......
......@@ -121,6 +121,7 @@ global:
bucket:
connection: {}
externalDiffs:
when:
proxy_download: true
bucket:
connection: {}
......
{{/*
Generates a templated config for artifacts key in gitlab.yml.
Usage:
{{ include "gitlab.appConfig.artifacts.configuration" ( \
dict \
"config" .Values.path.to.artifacts.config \
"context" $ \
) }}
*/}}
{{- define "gitlab.appConfig.artifacts.configuration" -}}
artifacts:
enabled: {{ if kindIs "bool" .config.enabled }}{{ eq .config.enabled true }}{{ end }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "artifacts" "config" .config "context" .context) | nindent 2 }}
{{- end -}}{{/* "gitlab.appConfig.artifacts.configuration" */}}
{{/*
Generates a templated config for external_diffs key in gitlab.yml.
Usage:
{{ include "gitlab.appConfig.external_diffs.configuration" ( \
dict \
"config" .Values.path.to.external_diffs.config \
"context" $ \
) }}
*/}}
{{- define "gitlab.appConfig.external_diffs.configuration" -}}
external_diffs:
enabled: {{ if kindIs "bool" .config.enabled }}{{ eq .config.enabled true }}{{ end }}
when: {{ .config.when }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "external_diffs" "config" .config "context" .context) | nindent 2 }}
{{- end -}}{{/* "gitlab.appConfig.external_diffs.configuration" */}}
{{/*
Generates a templated config for lfs key in gitlab.yml.
Usage:
{{ include "gitlab.appConfig.lfs.configuration" ( \
dict \
"config" .Values.path.to.lfs.config \
"context" $ \
) }}
*/}}
{{- define "gitlab.appConfig.lfs.configuration" -}}
lfs:
enabled: {{ if kindIs "bool" .config.enabled }}{{ eq .config.enabled true }}{{ end }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "lfs" "config" .config "context" .context) | nindent 2 }}
{{- end -}}{{/* "gitlab.appConfig.lfs.configuration" */}}
......@@ -10,26 +10,24 @@ Usage:
) }}
*/}}
{{- define "gitlab.appConfig.objectStorage.configuration" -}}
{{ .name }}:
enabled: {{ if kindIs "bool" .config.enabled }}{{ eq .config.enabled true }}{{ end }}
object_store:
enabled: true
remote_directory: {{ .config.bucket }}
direct_upload: true
background_upload: false
proxy_download: {{ or (not (kindIs "bool" .config.proxy_download)) .config.proxy_download }}
{{- if .context.Values.global.minio.enabled }}
connection:
provider: AWS
region: us-east-1
aws_access_key_id: "<%= File.read('/etc/gitlab/minio/accesskey') %>"
aws_secret_access_key: "<%= File.read('/etc/gitlab/minio/secretkey') %>"
host: {{ template "gitlab.minio.hostname" .context }}
endpoint: {{ template "gitlab.minio.endpoint" .context }}
path_style: true
{{- else if .config.connection }}
connection: <%= YAML.load_file("/etc/gitlab/objectstorage/{{ .name }}").to_json() %>
{{- end -}}
object_store:
enabled: true
remote_directory: {{ .config.bucket }}
direct_upload: true
background_upload: false
proxy_download: {{ or (not (kindIs "bool" .config.proxy_download)) .config.proxy_download }}
{{- if .context.Values.global.minio.enabled }}
connection:
provider: AWS
region: us-east-1
aws_access_key_id: "<%= File.read('/etc/gitlab/minio/accesskey') %>"
aws_secret_access_key: "<%= File.read('/etc/gitlab/minio/secretkey') %>"
host: {{ template "gitlab.minio.hostname" .context }}
endpoint: {{ template "gitlab.minio.endpoint" .context }}
path_style: true
{{- else if .config.connection }}
connection: <%= YAML.load_file("/etc/gitlab/objectstorage/{{ .name }}").to_json() %>
{{- end -}}
{{- end -}}{{/* "gitlab.appConfig.objectStorage.configuration" */}}
......
{{/*
Generates a templated config for packages key in gitlab.yml.
Usage:
{{ include "gitlab.appConfig.packages.configuration" ( \
dict \
"config" .Values.path.to.packages.config \
"context" $ \
) }}
*/}}
{{- define "gitlab.appConfig.packages.configuration" -}}
packages:
enabled: {{ if kindIs "bool" .config.enabled }}{{ eq .config.enabled true }}{{ end }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "packages" "config" .config "context" .context) | nindent 2 }}
{{- end -}}{{/* "gitlab.appConfig.packages.configuration" */}}
{{/*
Generates a templated config for uploads key in gitlab.yml.
Usage:
{{ include "gitlab.appConfig.uploads.configuration" ( \
dict \
"config" .Values.path.to.uploads.config \
"context" $ \
) }}
*/}}
{{- define "gitlab.appConfig.uploads.configuration" -}}
uploads:
enabled: {{ if kindIs "bool" .config.enabled }}{{ eq .config.enabled true }}{{ end }}
{{- include "gitlab.appConfig.objectStorage.configuration" (dict "name" "uploads" "config" .config "context" .context) | nindent 2 }}
{{- end -}}{{/* "gitlab.appConfig.uploads.configuration" */}}
......@@ -339,6 +339,7 @@ global:
connection: {}
externalDiffs:
enabled:
when:
proxy_download: true
bucket: gitlab-mr-diffs
connection: {}
......@@ -465,6 +466,13 @@ kubectl create secret generic gitlab-rails-storage \
--from-file=connection=rails.yaml
```
#### when (only for External MR Diffs)
`externalDiffs` setting has an additional key `when` to
[conditionally store specific diffs on object storage](https://docs.gitlab.com/ee/administration/merge_request_diffs.html#alternative-in-database-storage).
This setting is left empty by default in the Charts, for a default value to be
assigned by the Rails code.
### Incoming email settings
The incoming email settings are explained in the [command line options page](../installation/command-line-options.md#incoming-email-configuration).
......
......@@ -125,6 +125,8 @@ global:
# cron: "*/15 * * * *"
# pseudonymizer_worker:
# cron: "0 * * * *"
# schedule_migrate_external_diffs_worker
# cron: "15 * * * *"
## doc/charts/globals.md#gravatarlibravatar-settings
gravatar:
......@@ -157,6 +159,7 @@ global:
bucket: gitlab-packages
connection: {}
externalDiffs:
when:
bucket: gitlab-mr-diffs
connection: {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment