This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new ce6b257 Fix gitSync user in the helm Chart (#11127)
ce6b257 is described below
commit ce6b257de7b442e9103728c2a293df23ece909d2
Author: Jarek Potiuk <[email protected]>
AuthorDate: Fri Sep 25 12:31:45 2020 +0200
Fix gitSync user in the helm Chart (#11127)
There was a problem with user in Git Sync mode of the Helm Chart
in connection with the git sync image and official Airflow
image. Since we are using the official image, most of the
containers are run with the "50000" user, but the git-sync image
used by the git sync user is 65533 so we have to set it as
default. We also exposed that value as parameter, so that
another image could be used here as well.
---
chart/templates/_helpers.yaml | 2 ++
chart/tests/git-sync-scheduler_test.yaml | 2 ++
chart/tests/pod-template-file_test.yaml | 2 ++
chart/values.yaml | 1 +
4 files changed, 7 insertions(+)
diff --git a/chart/templates/_helpers.yaml b/chart/templates/_helpers.yaml
index 2199637..0b9695e 100644
--- a/chart/templates/_helpers.yaml
+++ b/chart/templates/_helpers.yaml
@@ -105,6 +105,8 @@
{{- define "git_sync_container"}}
- name: {{ .Values.dags.gitSync.containerName }}
image: "{{ .Values.dags.gitSync.containerRepository }}:{{
.Values.dags.gitSync.containerTag }}"
+ securityContext:
+ runAsUser: {{ .Values.dags.gitSync.uid }}
env:
{{- if .Values.dags.gitSync.sshKeySecret }}
- name: GIT_SSH_KEY_FILE
diff --git a/chart/tests/git-sync-scheduler_test.yaml
b/chart/tests/git-sync-scheduler_test.yaml
index a278cb8..20e1acf 100644
--- a/chart/tests/git-sync-scheduler_test.yaml
+++ b/chart/tests/git-sync-scheduler_test.yaml
@@ -54,6 +54,8 @@ tests:
path: spec.template.spec.containers[1]
value:
name: git-sync-test
+ securityContext:
+ runAsUser: 65533
image: test-registry/test-repo:test-tag
env:
- name: GIT_SYNC_REV
diff --git a/chart/tests/pod-template-file_test.yaml
b/chart/tests/pod-template-file_test.yaml
index 64e99f8..c9349ac 100644
--- a/chart/tests/pod-template-file_test.yaml
+++ b/chart/tests/pod-template-file_test.yaml
@@ -55,6 +55,8 @@ tests:
path: spec.initContainers[0]
value:
name: git-sync-test
+ securityContext:
+ runAsUser: 65533
image: test-registry/test-repo:test-tag
env:
- name: GIT_SYNC_REV
diff --git a/chart/values.yaml b/chart/values.yaml
index 373f09c..09912e6 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -616,3 +616,4 @@ dags:
containerRepository: k8s.gcr.io/git-sync
containerTag: v3.1.6
containerName: git-sync
+ uid: 65533