Bug 1304604 - [platformmanagement_public_544]--path doesn't work for oc expose
[platformmanagement_public_544]--path doesn't work for oc expose
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Michail Kargakis
Wei Sun
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-04 01:56 EST by Wei Sun
Modified: 2016-05-12 13:15 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-12 13:15:04 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wei Sun 2016-02-04 01:56:31 EST
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 10:07:17 EST
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-04 23:39:08 EST
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.