Bug 1304604

Summary: [platformmanagement_public_544]--path doesn't work for oc expose
Product: OKD Reporter: Wei Sun <wsun>
Component: ocAssignee: Michail Kargakis <mkargaki>
Status: CLOSED CURRENTRELEASE QA Contact: Wei Sun <wsun>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, mmccomas
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: 2016-05-12 17:15:04 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:

Description Wei Sun 2016-02-04 06:56:31 UTC
Description of problem:
Expose a service as a route in the specified path using oc expose command,but could not see the path in route json.

Version-Release number of selected component (if applicable):
devenv-rhel7_3325
# oc version
oc v1.1.1-400-g76ea550
kubernetes v1.2.0-alpha.4-851-g4a65fa1

How reproducible:
Always

Steps to Reproduce:
1.Create a new project

2.Add users to a security context constraint
# oadm policy add-scc-to-user privileged wsun --config=openshift.local.config/master/admin.kubeconfig

3.Add groups to a security context constraint
# oadm policy add-scc-to-group privileged system:serviceaccouts:wsun-test --config=openshift.local.config/master/admin.kubeconfig

4.Create the pod, service
#  oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/nginx-pod.json
# oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/edge/service_unsecure.json

5.Create the unsecure path-based route
# oc expose service hello-nginx --hostname=www.example.com --path=/test
# oc get route hello-nginx -o json

Actual results:
5.# oc get route hello-nginx -o json
{
    "kind": "Route",
    "apiVersion": "v1",
    "metadata": {
        "name": "hello-nginx",
        "namespace": "wsun-test",
        "selfLink": "/oapi/v1/namespaces/wsun-test/routes/hello-nginx",
        "uid": "c3fb0997-cb05-11e5-a2cd-0ea78b778929",
        "resourceVersion": "798",
        "creationTimestamp": "2016-02-04T06:08:52Z",
        "labels": {
            "name": "hello-nginx"
        }
    },
    "spec": {
        "host": "www.example.com",
        "to": {
            "kind": "Service",
            "name": "hello-nginx"
        },
        "port": {
            "targetPort": "http"
        }
    },
    "status": {}
}


Expected results:
Should have 
 "path": "/test",
like:
"spec": {
        "host": "hello-nginx2-wsun-test.router.default.svc.cluster.local",
        "path": "/test",
        "to": {
            "kind": "Service",
            "name": "hello-nginx"
        },
        "port": {
            "targetPort": 80
        }
    },


Additional info:

Comment 1 openshift-github-bot 2016-02-04 15:07:17 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/1cc96ecc37dcfda05e08f26c709bf0d1661537fa
Bug 1304604: add missing route generator param for path

Comment 2 Wei Sun 2016-02-05 04:39:08 UTC
Verified on devenv-rhel7_3335

Result:
# oc expose service hello-nginx --hostname=www.example.com --path=/test
route "hello-nginx" exposed
[root@ip-172-18-13-42 /]#  oc get route hello-nginx -o json
{
    "kind": "Route",
    "apiVersion": "v1",
    "metadata": {
        "name": "hello-nginx",
        "namespace": "wsun-1",
        "selfLink": "/oapi/v1/namespaces/wsun-1/routes/hello-nginx",
        "uid": "45ca7603-cbc2-11e5-9f87-0e0b19999ca9",
        "resourceVersion": "754",
        "creationTimestamp": "2016-02-05T04:38:15Z",
        "labels": {
            "name": "hello-nginx"
        }
    },
    "spec": {
        "host": "www.example.com",
        "path": "/test",
        "to": {
            "kind": "Service",
            "name": "hello-nginx"
        },
        "port": {
            "targetPort": "http"
        }
    },
    "status": {}
}