Skip to content

Instantly share code, notes, and snippets.

@sudhirpandey
Last active January 29, 2025 21:26
Show Gist options
  • Select an option

  • Save sudhirpandey/d13baf9bdaeb5f50db73d123e1197eb7 to your computer and use it in GitHub Desktop.

Select an option

Save sudhirpandey/d13baf9bdaeb5f50db73d123e1197eb7 to your computer and use it in GitHub Desktop.
openshift command line with Go templating and others
#To get all the projects
`oc get projects -o name |xargs -i oc get {} --template '{{ .metadata.name }}{{"\n"}}`
#To get all the routes
`oc get projects -o name |xargs -i oc get {} --template '{{ .metadata.name }}{{"\n"}}'|xargs -i oc get routes --template '{{range .items}}{{ .spec.host}}{{"\n"}}{{end}}' -n {}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment