From 301ad36dd2bb7365cca8a275556b5420cf4d1be2 Mon Sep 17 00:00:00 2001 From: hmike96 Date: Fri, 6 Dec 2019 01:40:49 -0500 Subject: [PATCH] [stable/airflow] bug fix to make git sync work with branches other then master (#19414) * bug fix to make git sync work with branches other then master Signed-off-by: Hewitt, Mike * remove not needed code Signed-off-by: Hewitt, Mike * git sync will work without init now Signed-off-by: Hewitt, Mike * git sync will work without init now Signed-off-by: Hewitt, Mike --- stable/airflow/Chart.yaml | 2 +- stable/airflow/templates/configmap-git-clone.yaml | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/stable/airflow/Chart.yaml b/stable/airflow/Chart.yaml index 69c5d438a15e..fb276dfda488 100644 --- a/stable/airflow/Chart.yaml +++ b/stable/airflow/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Airflow is a platform to programmatically author, schedule and monitor workflows name: airflow -version: 5.2.1 +version: 5.2.2 appVersion: 1.10.4 icon: https://airflow.apache.org/_images/pin_large.png home: https://airflow.apache.org/ diff --git a/stable/airflow/templates/configmap-git-clone.yaml b/stable/airflow/templates/configmap-git-clone.yaml index 6af10e086d20..fc02b1e19ed1 100644 --- a/stable/airflow/templates/configmap-git-clone.yaml +++ b/stable/airflow/templates/configmap-git-clone.yaml @@ -26,9 +26,7 @@ data: if [ -d "$DIR" ]; then rm -rf $( find $DIR -mindepth 1 ) fi - git clone $REPO $DIR - cd $DIR - git reset --hard $REF + git clone $REPO -b $REF $DIR git-sync.sh: | #!/bin/sh -e REPO=$1 @@ -43,5 +41,8 @@ data: chmod 600 ~/.ssh/* echo -e "HOST $REPO_HOST\n IdentityFile ~/.ssh/$PRIVATE_KEY" > ~/.ssh/config {{- end }} + {{- if eq .Values.dags.initContainer.enabled false }} + git clone $REPO -b $REF $DIR + {{- end }} cd $DIR while true; do git pull; date; sleep $SYNC_TIME; done