Last active
December 4, 2021 13:45
-
-
Save guimou/a48be4b76eaf9a05d344c6632f8d43f5 to your computer and use it in GitHub Desktop.
[OC delete items in one line] Deletes OpenShift item in one line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete Running pods | |
for pod in $(oc get pods | grep Running | awk '{print $1}'); do oc delete pod ${pod} --grace-period=1;done | |
# Delete Secrets | |
for secret in $(oc get secrets | awk '{if (NR!=1){print $1}}'); do oc delete secret ${secret};done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment