Skip to content

Instantly share code, notes, and snippets.

@hoop33
Created August 11, 2019 13:55
Show Gist options
  • Save hoop33/78603e34a0dafb724ded0154055ce6ef to your computer and use it in GitHub Desktop.
Save hoop33/78603e34a0dafb724ded0154055ce6ef to your computer and use it in GitHub Desktop.
OpenShift: zsh function that uses fzf and oc to rsh into a pod
function ocsh() {
local pods pod
pods=$(oc get pods | cut -d' ' -f 1 | sed '1d' | grep -v '\-build' | grep -v '\-deploy') &&
pod=$(echo "$pods" | fzf +m) &&
oc rsh $(echo "$pod")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment