Skip to content

Commit

Permalink
Merge pull request openshift-kni#33 from fedepaol/pauseunpauseindeploy
Browse files Browse the repository at this point in the history
Move the pause / unpause logic in feature_deploy.sh
  • Loading branch information
openshift-merge-robot authored Jan 23, 2020
2 parents 89c1863 + 6ce43e5 commit 09a374d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 22 deletions.
36 changes: 36 additions & 0 deletions hack/feature-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ export OC_TOOL="${OC_TOOL:-oc}"
# expect kustomize to be in PATH by default
KUSTOMIZE="${KUSTOMIZE:-kustomize}"

echo "[INFO]: Pausing"
# TODO patching to prevent https://bugzilla.redhat.com/show_bug.cgi?id=1792749 from happening
# remove this once the bug is fixed

set +e
mcps=$(${OC_TOOL} get mcp --no-headers -o custom-columns=":metadata.name")
for mcp in $mcps
do
retries=0
until [ $retries -ge 5 ]; do
${OC_TOOL} patch mcp "${mcp}" -p '{"spec":{"paused":true}}' --type=merge && break
sleep 1
retries=$((retries+1))
done
done
set -e

# Deploy features
success=0
iterations=0
Expand Down Expand Up @@ -58,8 +75,27 @@ do

# All features deployed successfully
success=1
done

echo "[INFO]: Sleeping before unpausing"
sleep 2m
echo "[INFO]: Unpausing"

# TODO patching to prevent https://bugzilla.redhat.com/show_bug.cgi?id=1792749 from happening
# remove this once the bug is fixed
mcps=$(oc get mcp --no-headers -o custom-columns=":metadata.name")

set +e
for mcp in $mcps
do
retries=0
until [ $retries -ge 5 ]; do
${OC_TOOL} patch mcp "${mcp}" -p '{"spec":{"paused":false}}' --type=merge && break
sleep 1
retries=$((retries+1))
done
done
set -e

if [[ $success -eq 1 ]]; then
echo "[INFO] Deployment successful"
Expand Down
14 changes: 0 additions & 14 deletions hack/feature-wait.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ if [ "$FEATURES" == "" ]; then
exit 1
fi

echo "[INFO]: Sleeping before unpausing"

sleep 2m

echo "[INFO]: Unpausing"

# TODO patching to prevent https://bugzilla.redhat.com/show_bug.cgi?id=1792749 from happening
# remove this once the bug is fixed
mcps=$(oc get mcp --no-headers -o custom-columns=":metadata.name")
for mcp in $mcps
do
oc patch mcp "${mcp}" -p '{"spec":{"paused":false}}' --type=merge
done

ELAPSED=0
TIMEOUT=120
export all_ready=false
Expand Down
8 changes: 0 additions & 8 deletions hack/setup-test-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,3 @@ spec:
---
EOF

echo "[INFO]: Pausing"
# TODO patching to prevent https://bugzilla.redhat.com/show_bug.cgi?id=1792749 from happening
# remove this once the bug is fixed
mcps=$(${OC_TOOL} get mcp --no-headers -o custom-columns=":metadata.name")
for mcp in $mcps
do
${OC_TOOL} patch mcp "${mcp}" -p '{"spec":{"paused":true}}' --type=merge
done

0 comments on commit 09a374d

Please sign in to comment.