This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 0359fc1  Add fixing of ownership also for sources in Breeze (#18464)
0359fc1 is described below

commit 0359fc158b4e6c8fae2656f7874ca2269f706bf4
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Sep 23 14:40:54 2021 +0200

    Add fixing of ownership also for sources in Breeze (#18464)
    
    In some cases files created inside the container on linux in
    sources are owned by root - so far we cleaned only some directories
    that we knew were touched by Airflow, but in case of branch
    switching some folders/files might also got created as owned
    by root.
    
    This PR adds AIRFLOW_SOURCES and "dags" folders to the list
    of folders to fix ownership of.
    
    This might lead to slightly longer exit time when exiting
    from Breeze, but since we are running it only when the host is
    Linux and the fixung is rather performant - with explicitly finding
    files and dirs owned by root, this should not be a problem.
    
    It would be much bigger problem on MacOS,Windows due to slow filesystem,
    but on MacOS it is not needed as there ownership mapping is done
    using the filesystem itself.
---
 scripts/in_container/_in_container_utils.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/in_container/_in_container_utils.sh 
b/scripts/in_container/_in_container_utils.sh
index d7d4b5e..ca0a84f 100644
--- a/scripts/in_container/_in_container_utils.sh
+++ b/scripts/in_container/_in_container_utils.sh
@@ -120,6 +120,8 @@ function in_container_fix_ownership() {
             "/root/.docker"
             "/opt/airflow/logs"
             "/opt/airflow/docs"
+            "/opt/airflow/dags"
+            "${AIRFLOW_SOURCES}"
         )
         find "${DIRECTORIES_TO_FIX[@]}" -print0 -user root 2>/dev/null |
             xargs --null chown "${HOST_USER_ID}.${HOST_GROUP_ID}" 
--no-dereference || true >/dev/null 2>&1

Reply via email to