openshift / origin

Conformance test suite for OpenShift
http://www.openshift.org
Apache License 2.0
8.5k stars 4.71k forks source link

UXP: Add Validated SCC to 'oc describe <pod>' #7901

Closed screeley44 closed 8 years ago

screeley44 commented 8 years ago

Add ability to see which SCC the pod was validated against when using 'oc describe pod mypod'. Better user experience as user doesn't have to search for it in the -o yaml

[root@k8dev nfs_error]# oc describe pod bb-host-pod1
Name:                   bb-host-pod1
Namespace:              default
Validated SCC Policy:   hostmount-anyuid     <--- added this to the describe
Image(s):               busybox
...

one liner from what I can tell by adding in pkg/security import for allocator:

fmt.Fprintf(out, "Validated SCC Policy:\t%s\n", pod.Annotations[allocator.ValidatedSCCAnnotation])

@smarterclayton @erinboyd @jeffvance - thoughts?

jeffvance commented 8 years ago

@screeley44 this seems simple enough to go directly to a PR. I have not had a chance to look at the code, but I suspect you can leverage the scc display from oc export pod annotations output.

smarterclayton commented 8 years ago

@kargakis since this is a change to the CLI

pweil- commented 8 years ago

@kargakis - FYI @screeley44 wanted to take this himself to get into the cli code @screeley44 - please tag @kargakis on the PR you open, thanks!