Skip to content

Instantly share code, notes, and snippets.

@sjenning
Created June 22, 2017 00:10
Show Gist options
  • Save sjenning/ac42430c05f39ffef2753a11c58224ae to your computer and use it in GitHub Desktop.
Save sjenning/ac42430c05f39ffef2753a11c58224ae to your computer and use it in GitHub Desktop.
#!/bin/bash
# Attempt to recreate pod stuck in Terminating
STOP=0
function testrun {
while [ $STOP -eq 0 ]; do
project=$1
template=$2
oc new-project $project
oc process -n openshift $template | oc create -n $project -f -
sleep 90
oc scale -n $project --replicas=5 dc $template
sleep 10
oc scale -n $project --replicas=3 dc $template
sleep 10
oc delete project $project
sleep 60
oc get projects | grep $project
if [ $? -eq 0 ]; then
echo "$project STUCK TERMINATING"
STOP=1
fi
done
}
testrun demo-php cakephp-mysql-example &
sleep 15
testrun demo-rails rails-postgresql-example &
sleep 15
testrun demo-nodejs nodejs-mongodb-example &
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment