promenade/tools/g2/lib/validate.sh
Mahmoudi, Ahmad (am495p) c302a083a6 Upgrade k8s from v1.17.3 to v1.18.6
This ps makes following changes to upgrade kubernetes from v1.17.3
to v1.18.6.
  - Updated all references to k8s images to 1.18.6
  - Updated command options and api object and versions based on
    k8s 1.18 release notes:
      https://kubernetes.io/docs/setup/release/notes/
  - Uplifted uwsgi to 2.0.19.1 to align with other airship
    components, and to bring in fixes and improvements.
  - Added build-essentials and python3-dev packages to pass the zull
    gate, which was looking for a c compiler.

Change-Id: I1160d1e6e2f02a0524043641b9296ea39edb301e
2020-08-19 15:56:45 +00:00

37 lines
1.2 KiB
Bash

validate_cluster() {
NAME=${1}
log Validating cluster via VM "${NAME}"
rsync_cmd "${TEMP_DIR}/scripts/validate-cluster.sh" "${NAME}:/root/promenade/"
ssh_cmd "${NAME}" /root/promenade/validate-cluster.sh
}
validate_etcd_membership() {
CLUSTER=${1}
VM=${2}
shift 2
EXPECTED_MEMBERS="${*}"
# NOTE(mark-burnett): Wait a moment for disks in test environment to settle.
sleep 60
log Validating "${CLUSTER}" etcd membership via "${VM}" for members: "${EXPECTED_MEMBERS[@]}"
local retries=25
for ((n=0;n<=retries;n++)); do
FOUND_MEMBERS=$(etcdctl_member_list "${CLUSTER}" "${VM}" | tr '\n' ' ' | sed 's/ $//')
log "Found \"${FOUND_MEMBERS}\", expected \"${EXPECTED_MEMBERS}\""
if [[ "x${EXPECTED_MEMBERS}" != "x${FOUND_MEMBERS}" ]]; then
log Etcd membership check failed for cluster "${CLUSTER}" on attempt "$n".
if [[ "$n" == "$retries" ]]; then
log Etcd membership check failed for cluster "${CLUSTER}" after "$n" retries. Exiting.
exit 1
fi
sleep 30
else
log Etcd membership check succeeded for cluster "${CLUSTER}" on attempt "${n}"
break
fi
done
}