From 219c821b2267a9800f72442e5efc6bd2bcb0f86d Mon Sep 17 00:00:00 2001 From: Scott Hussey Date: Mon, 26 Mar 2018 12:25:31 -0500 Subject: [PATCH] [Fix] import job crashloop - Relied on JSON field names being in a deterministic order. This is not guaranteed. Update import job to no longer assume this. Change-Id: I8d0a3abae94b99a94df61346b504517e2cb4a8ca --- charts/maas/templates/bin/_import-boot-resources.sh.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/maas/templates/bin/_import-boot-resources.sh.tpl b/charts/maas/templates/bin/_import-boot-resources.sh.tpl index e4aea0b..d85a222 100644 --- a/charts/maas/templates/bin/_import-boot-resources.sh.tpl +++ b/charts/maas/templates/bin/_import-boot-resources.sh.tpl @@ -47,7 +47,7 @@ function check_for_download { let JOB_TIMEOUT-=${RETRY_TIMER} sleep ${RETRY_TIMER} else - synced_imgs=$(maas ${ADMIN_USERNAME} boot-resources read | grep -B 3 'Synced' | grep 'ubuntu' | wc -l) + synced_imgs=$(maas ${ADMIN_USERNAME} boot-resources read | tr -d '\n' | grep -oE '{[^}]+}' | grep ubuntu | grep -c Synced) if [[ $synced_imgs -gt 0 ]] then echo 'Boot resources have completed importing'