oc get projects
works the same as any other oc get
command. It's important to know the full flexibility of this command, specifically the --output
flag:
$ oc get -h
...
-o, --output='': Output format. One of:
json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...
See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template
[http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template
[http://kubernetes.io/docs/user-guide/jsonpath].
...
In this case, oc get projects -o custom-columns
will likely be the best approach, although others like jsonpath
or go-template
will provide even more flexibility in controlling the output in case you want to use another delimiter instead of tabs.
Selecting a single project and outputting it as yaml, oc get project <project-name> -o yaml
will show you the full array of values that you are able to display.
To answer your specific question, on OpenShift the project creator is stored in a metadata annotation, openshift.io/requester
, and the creation timestamp is also stored in the metadata. To display the project name, creator, and creation timestamp on the command line, you can do so with:
oc get projects -o custom-columns=NAME:.metadata.name,OWNER:.metadata.annotations.openshift\\.io/requester,CREATED:.metadata.creationTimestamp
(Note the \\
is necessary to escape the .
in openshift.io
)