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

fix: add pre-check on scheduler statefulset before patch it #1676

Merged
merged 1 commit into from
Jan 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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