Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
add pre-check on scheduler statefulset before patch it
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuangMen committed Jan 7, 2021
1 parent 5ccff30 commit fe6c884
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ if [ "${scheduler_list}" == "" ]; then
exit 0
fi

query='{.spec.template.spec.containers[*].name}'

for scheduler in ${scheduler_list}; do
kubectl patch statefulset --namespace "$NAMESPACE" "${scheduler}" --patch "$patch"
probe="$(kubectl get statefulsets --namespace="${NAMESPACE}" "${scheduler}" --output=jsonpath="${query}")"
if [[ "${probe}" =~ "cc-deployment-updater-cc-deployment-updater" ]]; then
kubectl patch statefulset --namespace "$NAMESPACE" "${scheduler}" --patch "$patch"
fi
done

# Delete all existing scheduler pods; we can't just patch them as changing
Expand Down

0 comments on commit fe6c884

Please sign in to comment.