Skip to content

Commit

Permalink
Merge pull request kubevirt#2065 from cynepco3hahue/fix_wait_problem
Browse files Browse the repository at this point in the history
Fix the issues with 1.10 provider
  • Loading branch information
rmohr authored Mar 1, 2019
2 parents 11bd420 + 6e049f2 commit 0c5ec78
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 23 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 14 additions & 18 deletions automation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,23 @@ export WORKSPACE="${WORKSPACE:-$PWD}"
readonly ARTIFACTS_PATH="$WORKSPACE/exported-artifacts"
readonly TEMPLATES_SERVER="https://templates.ovirt.org/kubevirt/"

if [[ $TARGET =~ openshift-.* ]]; then
if [[ $TARGET =~ windows.* ]]; then
export KUBEVIRT_PROVIDER="k8s-1.11.0"
else
export KUBEVIRT_PROVIDER=$TARGET
fi

if [ ! -d "cluster/$KUBEVIRT_PROVIDER" ]; then
echo "The cluster provider $KUBEVIRT_PROVIDER does not exist"
exit 1
fi

if [[ $TARGET =~ os-.* ]]; then
# when testing on slow CI system cleanup sometimes takes very long.
# openshift clusters are more memory demanding. If the cleanup
# of old vms does not go fast enough they run out of memory.
# To still allow continuing with the tests, give more memory in CI.
export KUBEVIRT_MEMORY_SIZE=6144M
if [[ $TARGET =~ .*-crio ]]; then
export KUBEVIRT_PROVIDER="os-3.11.0-crio"
elif [[ $TARGET =~ .*-multus ]]; then
export KUBEVIRT_PROVIDER="os-3.11.0-multus"
else
export KUBEVIRT_PROVIDER="os-3.11.0"
fi
elif [[ $TARGET =~ .*-1.10.4 ]]; then
export KUBEVIRT_PROVIDER="k8s-1.10.11"
elif [[ $TARGET =~ .*-multus-1.13.3 ]]; then
export KUBEVIRT_PROVIDER="k8s-multus-1.13.3"
elif [[ $TARGET =~ .*-genie-1.11.1 ]]; then
export KUBEVIRT_PROVIDER="k8s-genie-1.11.1"
else
export KUBEVIRT_PROVIDER="k8s-1.11.0"
fi

export KUBEVIRT_NUM_NODES=2
Expand Down Expand Up @@ -110,7 +106,7 @@ safe_download() (
fi
)

if [[ $TARGET =~ openshift.* ]]; then
if [[ $TARGET =~ os-.* ]]; then
# Create images directory
if [[ ! -d $RHEL_NFS_DIR ]]; then
mkdir -p $RHEL_NFS_DIR
Expand Down Expand Up @@ -260,7 +256,7 @@ else
fi

# Prepare RHEL PV for Template testing
if [[ $TARGET =~ openshift-.* ]]; then
if [[ $TARGET =~ os-.* ]]; then
ginko_params="$ginko_params|Networkpolicy"

kubectl create -f - <<EOF
Expand Down
20 changes: 19 additions & 1 deletion cluster/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ until _kubectl -n kubevirt get kv kubevirt; do
done

# wait until KubeVirt is ready
_kubectl wait -n kubevirt kv kubevirt --for condition=Ready --timeout 180s || (echo "KubeVirt not ready in time" && exit 1)
if [[ "$KUBEVIRT_PROVIDER" =~ .*.10..* ]]; then
# k8s version 1.10.* does not have wait command
# TODO: drop it once we get rid of 1.10.* provider
timeout=180
sample=30
current_time=0
while [ -n "$(_kubectl -n kubevirt get kv kubevirt -o'custom-columns=status:status.conditions[*].type' --no-headers | grep -v Ready)" ]; do
echo "Waiting for kubevirt operator to have the Ready condition ..."
_kubectl -n kubevirt get kv kubevirt -o'custom-columns=status:status.conditions[*].type' --no-headers | grep >&2 -v Ready || true
sleep $sample

current_time=$((current_time + sample))
if [ $current_time -gt $timeout ]; then
exit 1
fi
done
else
_kubectl wait -n kubevirt kv kubevirt --for condition=Ready --timeout 180s || (echo "KubeVirt not ready in time" && exit 1)
fi

echo "Done"
2 changes: 1 addition & 1 deletion cluster/ephemeral-provider-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function _add_common_params() {
local params="--nodes ${KUBEVIRT_NUM_NODES} --memory ${KUBEVIRT_MEMORY_SIZE} --cpu 5 --random-ports --background --prefix $provider_prefix --registry-volume $(_registry_volume) kubevirtci/${image} ${KUBEVIRT_PROVIDER_EXTRA_ARGS}"
if [[ $TARGET =~ windows.* ]]; then
params=" --nfs-data $WINDOWS_NFS_DIR $params"
elif [[ $TARGET =~ openshift.* ]]; then
elif [[ $TARGET =~ os-.* ]]; then
params=" --nfs-data $RHEL_NFS_DIR $params"
fi
echo $params
Expand Down
6 changes: 3 additions & 3 deletions stdci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ sub-stages:
timeout: 4h
- k8s-multus-1.13.3
- k8s-genie-1.11.1
- openshift-3.11:
- os-3.11.0:
timeout: 4h
- openshift-3.11-crio:
- os-3.11.0-crio:
timeout: 4h
- openshift-3.11-multus
- os-3.11.0-multus
- windows2016
runtime_requirements:
support_nesting_level: 2
Expand Down

0 comments on commit 0c5ec78

Please sign in to comment.