Bug 1467760 - Identity creation cut the name which have whitespace
Identity creation cut the name which have whitespace
Status: CLOSED NOTABUG
Product: OpenShift Container Platform
Classification: Red Hat
Component: Auth (Show other bugs)
3.6.0
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Jordan Liggitt
Chuan Yu
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-04 23:19 EDT by ge liu
Modified: 2017-07-06 09:48 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-04 23:38:35 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 ge liu 2017-07-04 23:19:14 EDT
Description of problem:

Create both identity and egressnetworkpolicy with name that contain whitespace, identity name: 'x:b 1', identity create successfully, but the name becomes to "x:b", obviously, the '1' after whitespace have been cut, and egressnetworkpolicy "b 1" create successfully, the name is: "b 1" as expected.

How reproducible:
Always

Steps to Reproduce:

1. # cat object.json 
{"kind":"List","apiVersion":"v1","items":[
  {"kind":"EgressNetworkPolicy","apiVersion":"v1","metadata":{"name":"a","annotations":{"source":"original"}}},
  {"kind":"EgressNetworkPolicy","apiVersion":"v1","metadata":{"name":"b 1","annotations":{"source":"original"}}},
  {"kind":"Identity","apiVersion":"v1","metadata":{"name":"x:a","annotations":{"source":"original"}},"providerName":"x","providerUserName":"a"},
  {"kind":"Identity","apiVersion":"v1","metadata":{"name":"x:b 1","annotations":{"source":"original"}},"providerName":"x","providerUserName":"b"}
]}

2. # oc create  -f object.json 
egressnetworkpolicy "a" created
egressnetworkpolicy "b 1" created
identity "x:a" created
identity "x:b" created

3. # oc get identity x:b -o json
{
    "apiVersion": "v1",
    "kind": "Identity",
    "metadata": {
        "annotations": {
            "source": "original"
        },
        "creationTimestamp": "2017-07-05T02:52:55Z",
        "name": "x:b",
        "resourceVersion": "2736",
        "selfLink": "/oapi/v1/identities/x%3Ab",
        "uid": "0b8d473f-612d-11e7-9746-42010af0001d"
    },
    "providerName": "x",
    "providerUserName": "b",
    "user": {}
}

Actual results:

identity cut the name with whitespace without any prompt msg

Expected results:

identity could tackle the name with whitespace, or prompt warning msg at least
Comment 1 Jordan Liggitt 2017-07-04 23:38:35 EDT
The name provided when creating an Identity object is ignored, and the name is  forced to be "<providerName>:<providerUserName>"
Comment 2 ge liu 2017-07-05 00:42:39 EDT
@jliggitt, sorry, I could not catch up you, what's means of "The name provided when creating an Identity object is ignored, and the name is  forced to be "<providerName>:<providerUserName>" ?
Comment 3 Jordan Liggitt 2017-07-06 09:48:01 EDT
The name of an identity is generated based on the providerName and providerUserName in the object. The name on the incoming object is ignored.

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