SirishaGopigiri ad555d4d24 Integrate capi v0.4.2 and capm3 v0.5.0
The below manifest changes integrates capi v0.4.2 with capm3
v0.5.0 version. It changes the required manifests files
in the airshipctl. It upgrades capi to v1alpha4 and capm3 to
v1alpha5.

Closes: #518 #560
Change-Id: Ia9ea82ad8052e55f0e70f1038497a919ac7b9270
2021-10-13 13:30:52 -05:00

47 lines
1.5 KiB
Bash

#!/bin/sh
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -xe
export TIMEOUT=${TIMEOUT:-3600}
export CONDITION=${CONDITION:-"controlPlaneReady"}
export CHECK=${CHECK:-"true"}
end=$(($(date +%s) + $TIMEOUT))
echo "Waiting $TIMEOUT seconds for cluster to reach $CONDITION condition" 1>&2
while true; do
# TODO(vkuzmin): Add ability to wait for multiple clusters
if [ "$(kubectl \
--request-timeout 20s \
--context $KCTL_CONTEXT \
get -f $RENDERED_BUNDLE_PATH \
-o jsonpath={.status.$CONDITION})" == $CHECK ]
then
echo "Getting information about cluster" 1>&2
kubectl \
--request-timeout 20s \
--context $KCTL_CONTEXT \
get -f $RENDERED_BUNDLE_PATH 1>&2
echo "Cluster successfully reach $CONDITION condition" 1>&2
break
else
now=$(date +%s)
if [ $now -gt $end ]; then
echo "Cluster didn't reach $CONDITION condition before TIMEOUT=$TIMEOUT, exiting" 1>&2
exit 1
fi
sleep 15
fi
done