Skip to content

Instantly share code, notes, and snippets.

@guimou
Last active December 4, 2021 13:45
Show Gist options
  • Save guimou/a48be4b76eaf9a05d344c6632f8d43f5 to your computer and use it in GitHub Desktop.
Save guimou/a48be4b76eaf9a05d344c6632f8d43f5 to your computer and use it in GitHub Desktop.
[OC delete items in one line] Deletes OpenShift item in one line
# 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