Using the openshift cli ("oc") we can retrieve a list of deployment configurations within the current project with:
$/> oc get dc
I'd like to itereate over that list and query certain properties on the "oc describe [dcname]" for each deployment config.
What's a convenient way of doing that?
You can get just the names by using:
oc get dc -o name
You may though also want to look at using -o template and provide a template spec to extract the various settings you want.
oc get dc -o template --template '{{range .items}}{{.metadata.name}},{{index .metadata.labels "app"}}{{"\n"}}{{end }}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With