Description of problem: - We would like to create prefix namespace with requester name. - The background of this request is that OCP's project/namespace has to be unique. But there are no good way to create the project uniquely atm. Version-Release number of selected component (if applicable): - OCP 3.4 How reproducible: - 100% Steps to Reproduce: 1. Modify template like https://docs.openshift.com/container-platform/3.4/admin_guide/managing_projects.html#modifying-the-template-for-new-projects (e.g) ~~~ metadata: name: ${PROJECT_NAME}-${PROJECT_REQUESTING_USER} ~~~ Actual results: - Failed to create the project. ]$ oc new-project aaa Error from server: Internal error occurred: namespaces "aaa" not found Expected results: - Create the project with requester name suffix. Additional info: - According to Jordan's internal mail, it was possible in previous version(?) http://post-office.corp.redhat.com/archives/openshift-sme/2016-September/msg01441.html (However, as far as I tested on OCP 3.4, it doesn't work).
I think there are couple problems here: 1) Using the ${PROJECT_REQUESTING_USER} only for the project name won't work unless you do the same everywhere where ${PROJECT_NAME} parameter is used in the template (iow. RoleBindings, etc.) 2) https://github.com/openshift/origin/pull/14344 this has to be fixed 3) there is a bug in `new-project` that prevents the newly created project to be set.
Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/96e068b56c1432cdcdf55895dcd22f37124df0eb Bug 1454535 - Use created project name over namespace name in project template
Verified in OCP env: openshift v3.6.94 kubernetes v1.6.1+5115d708d7 etcd 3.1.0 Steps: 1. login OCP cluster, and working as system:admin user 2. #oadm create-bootstrap-project-template -o yaml > template.yaml 3. Edit template.yaml: replace ALL "name: ${PROJECT_NAME}" to "name: ${PROJECT_NAME}-lg", pay attention all items, but not project metadate name only. 4. modify master-config.yaml: projectRequestTemplate: "default/project-request" and restart master service 5. # oc new-project ccc --description=lala1 6. # oc get project NAME DISPLAY NAME STATUS ccc-lg Active
verified in openshift v3.6.94 kubernetes v1.6.1+5115d708d7 etcd 3.1.0 oc v3.6.94 [root@dhcp-128-91 Downloads]# ./usr/share/atomic-openshift/linux/oc new-project wewang Now using project "wewang-wewang" on server "https://host-xxxx:8443". You can add applications to this project with the 'new-app' command. For example, try: oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git to build a new example application in Ruby.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2017:3188
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days