From b54c5325e59389cfaa42e5015d1bf553b94d3c11 Mon Sep 17 00:00:00 2001 From: Daniel Hoherd Date: Tue, 22 Nov 2022 17:33:06 -0500 Subject: [PATCH 1/6] Use git-sync 3.6.1. Deprecate GIT_SYNC_WAIT in favor of GIT_SYNC_PERIOD. --- chart/templates/_helpers.yaml | 4 +++- chart/values.schema.json | 5 +++++ chart/values.yaml | 5 +++-- tests/charts/test_git_sync_scheduler.py | 2 ++ tests/charts/test_pod_template_file.py | 2 ++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/chart/templates/_helpers.yaml b/chart/templates/_helpers.yaml index 1ff7a64cae347..65949cd7b2dfb 100644 --- a/chart/templates/_helpers.yaml +++ b/chart/templates/_helpers.yaml @@ -214,8 +214,10 @@ If release name contains chart name it will be used as a full name. value: "repo" - name: GIT_SYNC_ADD_USER value: "true" - - name: GIT_SYNC_WAIT + - name: GIT_SYNC_WAIT # Deprecated: use GIT_SYNC_PERIOD value: {{ .Values.dags.gitSync.wait | quote }} + - name: GIT_SYNC_PERIOD + value: {{ .Values.dags.gitSync.period | quote }} - name: GIT_SYNC_MAX_SYNC_FAILURES value: {{ .Values.dags.gitSync.maxFailures | quote }} {{- if .is_init }} diff --git a/chart/values.schema.json b/chart/values.schema.json index 8a3048dc07c84..45b206c054f17 100644 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -5254,6 +5254,11 @@ "default": "tests/dags" }, "wait": { + "description": "Interval between git sync attempts in seconds. High values are more likely to cause DAGs to become out of sync between different components. Low values cause more traffic to the remote git repository. (Deprecated. Use 'period')", + "type": "integer", + "default": 5 + }, + "period": { "description": "Interval between git sync attempts in seconds. High values are more likely to cause DAGs to become out of sync between different components. Low values cause more traffic to the remote git repository.", "type": "integer", "default": 5 diff --git a/chart/values.yaml b/chart/values.yaml index 4680eee74a677..06a8fd074d697 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -93,7 +93,7 @@ images: pullPolicy: IfNotPresent gitSync: repository: k8s.gcr.io/git-sync/git-sync - tag: v3.4.0 + tag: v3.6.1 pullPolicy: IfNotPresent # Select certain nodes for airflow pods. @@ -1832,7 +1832,8 @@ dags: # interval between git sync attempts in seconds # high values are more likely to cause DAGs to become out of sync between different components # low values cause more traffic to the remote git repository - wait: 5 + period: 5 + wait: 5 # Deprecated: use 'period' containerName: git-sync uid: 65533 diff --git a/tests/charts/test_git_sync_scheduler.py b/tests/charts/test_git_sync_scheduler.py index e47d00686c974..adefba4107cb6 100644 --- a/tests/charts/test_git_sync_scheduler.py +++ b/tests/charts/test_git_sync_scheduler.py @@ -64,6 +64,7 @@ def test_validate_the_git_sync_container_spec(self): "enabled": True, "containerName": "git-sync-test", "wait": 66, + "period": 68, "maxFailures": 70, "subPath": "path1/path2", "rev": "HEAD", @@ -94,6 +95,7 @@ def test_validate_the_git_sync_container_spec(self): {"name": "GIT_SYNC_DEST", "value": "repo"}, {"name": "GIT_SYNC_ADD_USER", "value": "true"}, {"name": "GIT_SYNC_WAIT", "value": "66"}, + {"name": "GIT_SYNC_PERIOD", "value": "68"}, {"name": "GIT_SYNC_MAX_SYNC_FAILURES", "value": "70"}, ], "volumeMounts": [{"mountPath": "/git", "name": "dags"}], diff --git a/tests/charts/test_pod_template_file.py b/tests/charts/test_pod_template_file.py index fa5a9128c068f..0bf9b563909bb 100644 --- a/tests/charts/test_pod_template_file.py +++ b/tests/charts/test_pod_template_file.py @@ -68,6 +68,7 @@ def test_should_add_an_init_container_if_git_sync_is_true(self): "enabled": True, "containerName": "git-sync-test", "wait": 66, + "period": 68, "maxFailures": 70, "subPath": "path1/path2", "rev": "HEAD", @@ -99,6 +100,7 @@ def test_should_add_an_init_container_if_git_sync_is_true(self): {"name": "GIT_SYNC_DEST", "value": "repo"}, {"name": "GIT_SYNC_ADD_USER", "value": "true"}, {"name": "GIT_SYNC_WAIT", "value": "66"}, + {"name": "GIT_SYNC_PERIOD", "value": "68"}, {"name": "GIT_SYNC_MAX_SYNC_FAILURES", "value": "70"}, {"name": "GIT_SYNC_ONE_TIME", "value": "true"}, ], From d3a3c67612a19e40e342b255bee961b03d3b5d0e Mon Sep 17 00:00:00 2001 From: Daniel Hoherd Date: Tue, 22 Nov 2022 17:44:59 -0500 Subject: [PATCH 2/6] Replace deprecated env var in example. --- chart/values.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/values.schema.json b/chart/values.schema.json index 45b206c054f17..ad66172d8aa25 100644 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -5343,7 +5343,7 @@ }, "examples": [ { - "name": "GIT_SYNC_TIMEOUT", + "name": "GIT_SYNC_SYNC_TIMEOUT", "value": "60" } ] From 1410932abdad9cfeba69f513d4a14f997f7d00bb Mon Sep 17 00:00:00 2001 From: Daniel Hoherd Date: Tue, 22 Nov 2022 17:46:59 -0500 Subject: [PATCH 3/6] Add newsfragment --- newsfragments/27698.significant.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/27698.significant.rst diff --git a/newsfragments/27698.significant.rst b/newsfragments/27698.significant.rst new file mode 100644 index 0000000000000..e5780542a1579 --- /dev/null +++ b/newsfragments/27698.significant.rst @@ -0,0 +1 @@ +Begin deprecation of helm env var GIT_SYNC_WAIT in favor of GIT_SYNC_PERIOD. This is due to update of git-sync version. From 672e51e2f15d923acdb763612e15db168ab85e32 Mon Sep 17 00:00:00 2001 From: Daniel Hoherd Date: Fri, 20 Jan 2023 16:24:45 -0500 Subject: [PATCH 4/6] git-sync 3.6.3 --- chart/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/values.yaml b/chart/values.yaml index 06a8fd074d697..444a5884e2fd1 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -93,7 +93,7 @@ images: pullPolicy: IfNotPresent gitSync: repository: k8s.gcr.io/git-sync/git-sync - tag: v3.6.1 + tag: v3.6.3 pullPolicy: IfNotPresent # Select certain nodes for airflow pods. From bf9d8ba287bd209b417d20973a6d29eed3e3fb91 Mon Sep 17 00:00:00 2001 From: Daniel Hoherd Date: Fri, 20 Jan 2023 16:35:49 -0500 Subject: [PATCH 5/6] Undo everything except the version change as per @jedcunningham --- .../pod_template_file_examples/git_sync_template.yaml | 2 +- chart/templates/_helpers.yaml | 4 +--- chart/values.schema.json | 9 ++------- chart/values.yaml | 3 +-- newsfragments/27698.significant.rst | 1 - tests/charts/test_git_sync_scheduler.py | 2 -- tests/charts/test_pod_template_file.py | 2 -- 7 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 newsfragments/27698.significant.rst diff --git a/airflow/kubernetes/pod_template_file_examples/git_sync_template.yaml b/airflow/kubernetes/pod_template_file_examples/git_sync_template.yaml index 021c113832adf..54d5361bb0114 100644 --- a/airflow/kubernetes/pod_template_file_examples/git_sync_template.yaml +++ b/airflow/kubernetes/pod_template_file_examples/git_sync_template.yaml @@ -26,7 +26,7 @@ metadata: spec: initContainers: - name: git-sync - image: "k8s.gcr.io/git-sync/git-sync:v3.4.0" + image: "k8s.gcr.io/git-sync/git-sync:v3.6.3" env: - name: GIT_SYNC_BRANCH value: "v2-2-stable" diff --git a/chart/templates/_helpers.yaml b/chart/templates/_helpers.yaml index b9df27bf58d81..074ecc7d4914c 100644 --- a/chart/templates/_helpers.yaml +++ b/chart/templates/_helpers.yaml @@ -214,10 +214,8 @@ If release name contains chart name it will be used as a full name. value: "repo" - name: GIT_SYNC_ADD_USER value: "true" - - name: GIT_SYNC_WAIT # Deprecated: use GIT_SYNC_PERIOD + - name: GIT_SYNC_WAIT value: {{ .Values.dags.gitSync.wait | quote }} - - name: GIT_SYNC_PERIOD - value: {{ .Values.dags.gitSync.period | quote }} - name: GIT_SYNC_MAX_SYNC_FAILURES value: {{ .Values.dags.gitSync.maxFailures | quote }} {{- if .is_init }} diff --git a/chart/values.schema.json b/chart/values.schema.json index fdb8279a74e2e..bc2bb347f20d9 100644 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -680,7 +680,7 @@ "tag": { "description": "The gitSync image tag.", "type": "string", - "default": "v3.4.0" + "default": "v3.6.3" }, "pullPolicy": { "description": "The gitSync image pull policy.", @@ -5353,11 +5353,6 @@ "default": "tests/dags" }, "wait": { - "description": "Interval between git sync attempts in seconds. High values are more likely to cause DAGs to become out of sync between different components. Low values cause more traffic to the remote git repository. (Deprecated. Use 'period')", - "type": "integer", - "default": 5 - }, - "period": { "description": "Interval between git sync attempts in seconds. High values are more likely to cause DAGs to become out of sync between different components. Low values cause more traffic to the remote git repository.", "type": "integer", "default": 5 @@ -5442,7 +5437,7 @@ }, "examples": [ { - "name": "GIT_SYNC_SYNC_TIMEOUT", + "name": "GIT_SYNC_TIMEOUT", "value": "60" } ] diff --git a/chart/values.yaml b/chart/values.yaml index 62c57a7fae4f2..dc14435e67561 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1865,8 +1865,7 @@ dags: # interval between git sync attempts in seconds # high values are more likely to cause DAGs to become out of sync between different components # low values cause more traffic to the remote git repository - period: 5 - wait: 5 # Deprecated: use 'period' + wait: 5 containerName: git-sync uid: 65533 diff --git a/newsfragments/27698.significant.rst b/newsfragments/27698.significant.rst deleted file mode 100644 index e5780542a1579..0000000000000 --- a/newsfragments/27698.significant.rst +++ /dev/null @@ -1 +0,0 @@ -Begin deprecation of helm env var GIT_SYNC_WAIT in favor of GIT_SYNC_PERIOD. This is due to update of git-sync version. diff --git a/tests/charts/test_git_sync_scheduler.py b/tests/charts/test_git_sync_scheduler.py index adefba4107cb6..e47d00686c974 100644 --- a/tests/charts/test_git_sync_scheduler.py +++ b/tests/charts/test_git_sync_scheduler.py @@ -64,7 +64,6 @@ def test_validate_the_git_sync_container_spec(self): "enabled": True, "containerName": "git-sync-test", "wait": 66, - "period": 68, "maxFailures": 70, "subPath": "path1/path2", "rev": "HEAD", @@ -95,7 +94,6 @@ def test_validate_the_git_sync_container_spec(self): {"name": "GIT_SYNC_DEST", "value": "repo"}, {"name": "GIT_SYNC_ADD_USER", "value": "true"}, {"name": "GIT_SYNC_WAIT", "value": "66"}, - {"name": "GIT_SYNC_PERIOD", "value": "68"}, {"name": "GIT_SYNC_MAX_SYNC_FAILURES", "value": "70"}, ], "volumeMounts": [{"mountPath": "/git", "name": "dags"}], diff --git a/tests/charts/test_pod_template_file.py b/tests/charts/test_pod_template_file.py index 0bf9b563909bb..fa5a9128c068f 100644 --- a/tests/charts/test_pod_template_file.py +++ b/tests/charts/test_pod_template_file.py @@ -68,7 +68,6 @@ def test_should_add_an_init_container_if_git_sync_is_true(self): "enabled": True, "containerName": "git-sync-test", "wait": 66, - "period": 68, "maxFailures": 70, "subPath": "path1/path2", "rev": "HEAD", @@ -100,7 +99,6 @@ def test_should_add_an_init_container_if_git_sync_is_true(self): {"name": "GIT_SYNC_DEST", "value": "repo"}, {"name": "GIT_SYNC_ADD_USER", "value": "true"}, {"name": "GIT_SYNC_WAIT", "value": "66"}, - {"name": "GIT_SYNC_PERIOD", "value": "68"}, {"name": "GIT_SYNC_MAX_SYNC_FAILURES", "value": "70"}, {"name": "GIT_SYNC_ONE_TIME", "value": "true"}, ], From 15d53825ef4604d4b2ded02fa5df3863db58389b Mon Sep 17 00:00:00 2001 From: Daniel Hoherd Date: Fri, 20 Jan 2023 18:58:57 -0500 Subject: [PATCH 6/6] Add newsfragment --- newsfragments/27698.significant.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/27698.significant.rst diff --git a/newsfragments/27698.significant.rst b/newsfragments/27698.significant.rst new file mode 100644 index 0000000000000..f55ab850acae3 --- /dev/null +++ b/newsfragments/27698.significant.rst @@ -0,0 +1 @@ +Use git-sync 3.6.3.