Skip to content

Instantly share code, notes, and snippets.

@hemanth22
Forked from FreedomBen/oc-get-all-resources.sh
Created July 16, 2022 13:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hemanth22/a0649ec1872d94bb47c54b3095d63bcb to your computer and use it in GitHub Desktop.
Save hemanth22/a0649ec1872d94bb47c54b3095d63bcb to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Versoin one
oc get $(oc api-resources --namspaced=true | tail -n+2 | awk '{ print $1 }' | xargs | sed -e 's/\s/,/g')
# Version two (from https://access.redhat.com/solutions/4165791)
oc api-resources --verbs=list --namespaced -o name | xargs -n 1 oc get --show-kind --ignore-not-found -n $PROJECT_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment