Skip to content
Snippets Groups Projects
Commit db9ae5bc authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

fix: keep last running instance

parent f71b0ad4
No related branches found
No related tags found
No related merge requests found
......@@ -445,8 +445,8 @@ cleanup_knightly:
script:
- >
SERVER_TO_BE_DELETE=($(openstack server list --name $OOD_INSTANCE_NAME --sort-column Image --sort-descending -f value -c ID
| awk -v NSTK=$NUM_SERVER_TO_KEEP '{count++}
{if (count>NSTK) print}'))
| awk -v NSTK=$NUM_SERVER_TO_KEEP -v OID=$OLD_INSTANCE_ID '$0 != OID {count++} \
$0 != OID && count>NSTK {print}'))
- |
for svr in ${SERVER_TO_BE_DELETE[@]}; do
echo "Deleting server $svr"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment