fix: tolerate active helm reconciles
This commit is contained in:
@@ -258,6 +258,7 @@ jobs:
|
|||||||
local handled
|
local handled
|
||||||
local ready
|
local ready
|
||||||
local healthy
|
local healthy
|
||||||
|
local reconciling
|
||||||
local generation
|
local generation
|
||||||
local observed_generation
|
local observed_generation
|
||||||
|
|
||||||
@@ -273,9 +274,15 @@ jobs:
|
|||||||
|
|
||||||
ready="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>/dev/null || true)"
|
ready="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>/dev/null || true)"
|
||||||
healthy="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.conditions[?(@.type=="Healthy")].status}' 2>/dev/null || true)"
|
healthy="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.conditions[?(@.type=="Healthy")].status}' 2>/dev/null || true)"
|
||||||
|
reconciling="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.conditions[?(@.type=="Reconciling")].status}' 2>/dev/null || true)"
|
||||||
generation="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.metadata.generation}' 2>/dev/null || true)"
|
generation="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.metadata.generation}' 2>/dev/null || true)"
|
||||||
observed_generation="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.observedGeneration}' 2>/dev/null || true)"
|
observed_generation="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.observedGeneration}' 2>/dev/null || true)"
|
||||||
|
|
||||||
|
if [[ "${resource}" == helmrelease/* ]] && [ "${reconciling}" = "True" ]; then
|
||||||
|
echo "${resource} did not report reconcile ${reconcile_at}, but it is actively reconciling; continuing"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${ready}" = "True" ] && [ "${observed_generation}" = "${generation}" ]; then
|
if [ "${ready}" = "True" ] && [ "${observed_generation}" = "${generation}" ]; then
|
||||||
if [ -z "${healthy}" ] || [ "${healthy}" = "True" ]; then
|
if [ -z "${healthy}" ] || [ "${healthy}" = "True" ]; then
|
||||||
echo "${resource} did not report reconcile ${reconcile_at}, but it is already Ready; continuing"
|
echo "${resource} did not report reconcile ${reconcile_at}, but it is already Ready; continuing"
|
||||||
@@ -621,6 +628,7 @@ jobs:
|
|||||||
local handled
|
local handled
|
||||||
local ready
|
local ready
|
||||||
local healthy
|
local healthy
|
||||||
|
local reconciling
|
||||||
local generation
|
local generation
|
||||||
local observed_generation
|
local observed_generation
|
||||||
|
|
||||||
@@ -636,9 +644,15 @@ jobs:
|
|||||||
|
|
||||||
ready="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>/dev/null || true)"
|
ready="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>/dev/null || true)"
|
||||||
healthy="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.conditions[?(@.type=="Healthy")].status}' 2>/dev/null || true)"
|
healthy="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.conditions[?(@.type=="Healthy")].status}' 2>/dev/null || true)"
|
||||||
|
reconciling="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.conditions[?(@.type=="Reconciling")].status}' 2>/dev/null || true)"
|
||||||
generation="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.metadata.generation}' 2>/dev/null || true)"
|
generation="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.metadata.generation}' 2>/dev/null || true)"
|
||||||
observed_generation="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.observedGeneration}' 2>/dev/null || true)"
|
observed_generation="$(kubectl -n "${namespace}" get "${resource}" -o jsonpath='{.status.observedGeneration}' 2>/dev/null || true)"
|
||||||
|
|
||||||
|
if [[ "${resource}" == helmrelease/* ]] && [ "${reconciling}" = "True" ]; then
|
||||||
|
echo "${resource} did not report reconcile ${reconcile_at}, but it is actively reconciling; continuing"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${ready}" = "True" ] && [ "${observed_generation}" = "${generation}" ]; then
|
if [ "${ready}" = "True" ] && [ "${observed_generation}" = "${generation}" ]; then
|
||||||
if [ -z "${healthy}" ] || [ "${healthy}" = "True" ]; then
|
if [ -z "${healthy}" ] || [ "${healthy}" = "True" ]; then
|
||||||
echo "${resource} did not report reconcile ${reconcile_at}, but it is already Ready; continuing"
|
echo "${resource} did not report reconcile ${reconcile_at}, but it is already Ready; continuing"
|
||||||
|
|||||||
Reference in New Issue
Block a user