Browse Source

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

changes/40/672540/8
Zuul 4 days ago
parent
commit
390f98784a
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      tools/deployment/airskiff/developer/030-armada-bootstrap.sh

+ 10
- 2
tools/deployment/airskiff/developer/030-armada-bootstrap.sh View File

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

Loading…
Cancel
Save