Skip to content

Instantly share code, notes, and snippets.

@patlachance
Created February 10, 2021 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patlachance/c9e245782a60067d7b7cf72a11ac48c3 to your computer and use it in GitHub Desktop.
Save patlachance/c9e245782a60067d7b7cf72a11ac48c3 to your computer and use it in GitHub Desktop.
Useful openshift / kubernetes commands

Identify CRDs and APIServices resources owned by an operator

Read: https://olm.operatorframework.io/docs/tasks/uninstall-operator/

To run before removing an operator, because operator's owned resources may not be removed to avoid data loss.

$ oc get csv cert-manager-operator.v0.15.3 \
     -o=jsonpath='{"customresourcedefinitions: "}{.spec.customresourcedefinitions.owned[].name}{"\n"}{"apiservicedefinitions: "}{.spec.apiservicedefinitions.owned[].name}{"\n"}'

Output:

customresourcedefinitions: certmanagers.operator.cert-manager.io
apiservicedefinitions: 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment