Merge "Set permissions of kube config like airskiff.yaml"

This commit is contained in:
Zuul 2019-08-12 19:40:43 +00:00 committed by Gerrit Code Review
commit 390f98784a
1 changed files with 10 additions and 2 deletions

View File

@ -25,10 +25,17 @@ set -xe
# Render documents
${PEGLEG} site -r . render "${PL_SITE}" -o airskiff.yaml
# Set permissions o+r, beacause it need to be readable
# Set permissions o+r, beacause these files need to be readable
# for Armada in the container
AIRSKIFF_PERMISSIONS=$(stat --format '%a' airskiff.yaml)
KUBE_CONFIG_PERMISSIONS=$(stat --format '%a' ~/.kube/config)
sudo chmod 0644 airskiff.yaml
sudo chmod 0644 ~/.kube/config
# In the event that this docker command fails, we want to continue the script
# and reset the file permissions.
set +e
# Download latest Armada image and deploy Airship components
docker run --rm --net host -p 8000:8000 --name armada \
@ -38,5 +45,6 @@ docker run --rm --net host -p 8000:8000 --name armada \
quay.io/airshipit/armada:latest \
apply /airskiff.yaml --target-manifest $TARGET_MANIFEST
# Set back permissions of the file
# Set back permissions of the files
sudo chmod "${AIRSKIFF_PERMISSIONS}" airskiff.yaml
sudo chmod "${KUBE_CONFIG_PERMISSIONS}" ~/.kube/config