Bug 1304604 - [platformmanagement_public_544]--path doesn't work for oc expose
Summary: [platformmanagement_public_544]--path doesn't work for oc expose
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Michail Kargakis
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-04 06:56 UTC by Wei Sun
Modified: 2016-05-12 17:15 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 17:15:04 UTC
Target Upstream Version:


Attachments (Terms of Use)

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": {}
}


Note You need to log in before you can comment on or make changes to this bug.