Skip to content

Commit

Permalink
[AIRFLOW-6823] Fix root owned files automatically in Breeze (apache#7449
Browse files Browse the repository at this point in the history
)

(cherry picked from commit 03fb50a)
  • Loading branch information
potiuk authored and kaxil committed Mar 19, 2020
1 parent 722b17f commit 8580d1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions scripts/ci/_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ EOF
confirm_image_rebuild
fi
if [[ ${SKIP_REBUILD} != "true" ]]; then
ROOT_FILES_COUNT=$(find "airflow" "tests" -user root | wc -l)
if [[ ${ROOT_FILES_COUNT} != "0" ]]; then
./scripts/ci/ci_fix_ownership.sh
fi
print_info
print_info "${ACTION} start: ${THE_IMAGE_TYPE} image."
print_info
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/in_container/_in_container_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ function in_container_fix_ownership() {
print_in_container_info "Changing ownership of root-owned files to ${HOST_USER_ID}.${HOST_GROUP_ID}"
print_in_container_info
set +o pipefail
sudo find . -user root | sudo xargs chown -v "${HOST_USER_ID}.${HOST_GROUP_ID}" | wc -l | \
xargs -n 1 echo "Number of files with changed ownership:"
sudo find . -user root | sudo xargs chown -v "${HOST_USER_ID}.${HOST_GROUP_ID}" --no-dereference | \
wc -l | xargs -n 1 echo "Number of files with changed ownership:"
set -o pipefail
print_in_container_info
print_in_container_info
Expand Down

0 comments on commit 8580d1f

Please sign in to comment.