Bug 1249150

Summary: oc exec -p docker-registry-1-da73t find /registry does not work with latest registry container
Product: OpenShift Container Platform Reporter: Ryan Howe <rhowe>
Component: DocumentationAssignee: brice <bfallonf>
Status: CLOSED CURRENTRELEASE QA Contact: Vikram Goyal <vigoyal>
Severity: medium Docs Contact: Vikram Goyal <vigoyal>
Priority: high    
Version: 3.0.0CC: cvantuin, jokerman, libra-onpremise-devel, mmccomas, rhowe
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-20 00:48:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1254014    

Description Ryan Howe 2015-07-31 16:10:59 UTC
Document URL: https://docs.openshift.com/enterprise/3.0/admin_guide/install/docker_registry.html#file-storage

Section Number and Name: file storage

Describe the issue:  

# oc exec -p docker-registry-1-da73t find /registry

The find command is not a command in the latest registry container. 

Suggestions for improvement: 

Instead use the following command to open a bash shell in the registry 

oc exec -p docker-registry-1-5deze -i -t -- bash -il

Additional information:

Comment 2 brice 2015-09-14 04:37:22 UTC
PR submitted:

https://github.com/openshift/openshift-docs/pull/960

Ryan, my test machine is currently out of commission, so I couldn't get test out this command myself, so i may be wrong, but it looks like this is simply opening up a bash shell into the pod. Is there an missing command to be run after this one to list the registry contents?

Comment 3 Ryan Howe 2015-09-14 13:56:25 UTC

Following the instructions results in the following:

[root@master ~]# oc exec -p docker-registry-1-2r24y -i -t -- bash -il
W0914 09:44:51.565795 54908 cmd.go:149] -p POD is DEPRECATED and will be removed in a future version. Use exec POD instead.

Error from server: Pod "Unknown" is forbidden: Cannot exec into a privileged container

Steps to lead up to this:

$ echo '{"kind":"ServiceAccount","apiVersion":"v1","metadata":{"name":"registry"}}' | oc create -n default -f -
$ oc edit scc privileged

ADDED

    system:serviceaccount:default:registry

$ oadm registry --service-account=registry --config=/etc/openshift/master/admin.kubeconfig --credentials=/etc/openshift/master/openshift-registry.kubeconfig --images='registry.access.redhat.com/openshift3/ose-${component}:${version}' --mount-host=/mnt/registry --selector="zone=west"
$ oc get all
$ oc get pods --watch
$  oc exec -p docker-registry-1-2r24y -i -t -- bash -il

Comment 4 Ryan Howe 2015-09-18 20:13:23 UTC
This explains the what has changed. The oc exec will not work on privileged containers 

https://bugzilla.redhat.com/show_bug.cgi?id=1255120

Comment 5 brice 2015-09-24 04:51:51 UTC
I've replaced the command in the section, but also added in an Important box after the example explaining the restrictions of privileged container.

Ryan, if there's anything else for this BZ, please let me know.

Thanks!

Comment 6 brice 2015-10-12 00:17:02 UTC
PR merged:

https://github.com/openshift/openshift-docs/pull/960

Comment 7 Timothy 2015-12-08 04:05:02 UTC
*** Bug 1254014 has been marked as a duplicate of this bug. ***