diff --git a/tests/scripts/uninstall_milvus.sh b/tests/scripts/uninstall_milvus.sh index c5197ee008222b238039c9bf0d06300ce7559fd1..356d8c666af8ee1a435f3db38763c8f58e1c3d82 100755 --- a/tests/scripts/uninstall_milvus.sh +++ b/tests/scripts/uninstall_milvus.sh @@ -78,27 +78,4 @@ MILVUS_LABELS2="release=${MILVUS_HELM_RELEASE_NAME}" # Clean up pvc kubectl delete pvc --wait -n "${MILVUS_HELM_NAMESPACE}" $(kubectl get pvc -n "${MILVUS_HELM_NAMESPACE}" -l "${MILVUS_LABELS1}" -o jsonpath='{range.items[*]}{.metadata.name} ') || true -kubectl delete pvc --wait -n "${MILVUS_HELM_NAMESPACE}" $(kubectl get pvc -n "${MILVUS_HELM_NAMESPACE}" -l "${MILVUS_LABELS2}" -o jsonpath='{range.items[*]}{.metadata.name} ') || true - -# Add check & delete pvc again in case pvc need time to be deleted -clean_label_pvc(){ - local label=${1?label expected as first argument.} - - for i in {1..10} - do - PVC=$(kubectl get pvc -n "${MILVUS_HELM_NAMESPACE}" -l "${label}" -o jsonpath='{range.items[*]}{.metadata.name} ') - STATUS=$(echo ${PVC} | wc -w ) - echo "status is ${STATUS}" - if [ $STATUS == 0 ]; then - break - else - sleep 5 - echo "PVCs are ${PVC}" - kubectl delete pvc --wait -n "${MILVUS_HELM_NAMESPACE}" ${PVC} - fi - done -} - -echo "Check & Delete Persistent Volumes" -clean_label_pvc ${MILVUS_LABELS1} -clean_label_pvc ${MILVUS_LABELS2} \ No newline at end of file +kubectl delete pvc --wait -n "${MILVUS_HELM_NAMESPACE}" $(kubectl get pvc -n "${MILVUS_HELM_NAMESPACE}" -l "${MILVUS_LABELS2}" -o jsonpath='{range.items[*]}{.metadata.name} ') || true \ No newline at end of file