Commit ec370958 by 据说甜蜜呢

删除文件

parent 256bc38b
#!/bin/bash
IFS=$'\n\n'
# Import external functions
chmod +x ./devops/PipeLines/functions.sh
sh ./devops/PipeLines/functions.sh
GetNameSpace namespace
declare replicas=$(kubectl -n ${namespace} get rs)
for row in $replicas
do
declare name=$(echo "${row}"|awk '{print $1}')
declare desired=$(echo "${row}"|awk '{print $2}')
declare current=$(echo "${row}"|awk '{print $3}')
declare ready=$(echo "${row}"|awk '{print $4}')
# echo "replica set: ${name}, desired: ${desired}"
if [ $((${desired})) == 0 -a $((${current})) == 0 -a $((${ready})) == 0 ]; then
# echo ${name}
kubectl -n ${namespace} delete rs ${name} --grace-period=0 --force
fi
done
echo 'clean successful...'
exit 0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment