FIX: disk space check tests /shared
authorJay Pfaffman <pfaffman@gmail.com>
Fri, 1 Jun 2018 02:29:09 +0000 (21:29 -0500)
committerGitHub <noreply@github.com>
Fri, 1 Jun 2018 02:29:09 +0000 (21:29 -0500)
If `/shared` is not the same as `/`then the disk space test fails because it's testing the wrong partition.
For example, if `/` is too small you might create a separate partition for postgres so there will be enough room to update.

templates/postgres.template.yml

index a970dcc7f575fa1d8d4d47f9f443793d61b3553e..30daf5f58b305bae8d414c2f6a19a288042f2955 100644 (file)
@@ -62,7 +62,7 @@ run:
 
        if [ ! "10" = "$PG_MAJOR_OLD" ]; then
          echo Upgrading PostgreSQL from version ${PG_MAJOR_OLD} to 10
-         free_disk=$(df /var | tail -n 1 | awk '{print $4}')
+         free_disk=$(df /shared | tail -n 1 | awk '{print $4}')
          required=$(($(du -s /shared/postgres_data | awk '{print $1}') * 2))
 
          if [ "$free_disk" -lt "$required" ]; then