Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1323997 - Error messages for 'clusterrolebindings' change type to 'rolebindings'
Error messages for 'clusterrolebindings' change type to 'rolebindings'
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Routing (Show other bugs)
3.2.0
All All
low Severity low
: ---
: ---
Assigned To: jtanenba
zhaozhanqi
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-05 06:11 EDT by zhaozhanqi
Modified: 2017-03-08 13 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-18 07:39:40 EST
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 12:23:26 EST

  None (edit)
Description zhaozhanqi 2016-04-05 06:11:49 EDT
Description of problem:
one error message will show 'error: rolebinding "router-third-role" already exists' if the related role already exist when creating router pod.  Actually, The error message should not use 'rolebinding' since cannot get that role via 'oc get rolebinding'. should update this keyword to 'clusterrolebinding'

Version-Release number of selected component (if applicable):
# openshift version
openshift v3.2.0.11
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5


How reproducible:
always

Steps to Reproduce:
1. Create router with name 'first'
2. Delete router dc/first and service 'first'
3. Create router again with name 'first'

Actual results:

step 3 an error message will show:

error: rolebinding "router-first-role" already exists


Expected results:

the error message should be :
error: clusterrolebindings "router-first-role" already exists.

Additional info:
Comment 1 Ben Bennett 2016-04-05 08:37:14 EDT
oc get rolebinding is supported now:

# oc get rolebinding
NAME                   ROLE                    USERS     GROUPS                           SERVICE ACCOUNTS     SUBJECTS
admin                  /admin                  ...
Comment 2 zhaozhanqi 2016-04-05 09:25:24 EDT
yes, but oc get rolebinding cannot show the related info

# oc get rolebinding |grep -i router-first-role   #return nothing.


*********************************************

# oc get clusterrolebindings |grep -i router-first-role
router-first-role                  /system:router                                                                                     default/router
Comment 3 jtanenba 2016-09-20 09:56:12 EDT
The problem does not have to do with the router specifically but with the delegation of clusterrolebinding actions to rolebinding (under the hood).


[root@localhost ~]# oc get clusterrolebindings doesnotexist
Error from server: rolebinding "doesnotexist" not found

[root@localhost ~]# oc delete clusterrolebindings doesnotexist
Error from server: rolebinding "doesnotexist" not found

and so forth


This happens because when a user attempts to create/access clusterrolebinding objects objects get converted to rolebinding objects and when errors occur the hardcoded error returned from the rolebinding functions propagate up unchanged.
Comment 4 jtanenba 2016-09-28 10:18:42 EDT
Posted: https://github.com/openshift/origin/pull/11099
Comment 5 openshift-github-bot 2016-10-06 14:08:04 EDT
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/a1a5cdd9d5e7715a2c1eb825fc4a797ee767601d
fix error messages for clusterrolebinding

when accessing clusterrolebindings, on an error the system currently
displays the type erroneously as rolebinding by adding the type to the
struct makes it easy to return the correct type

fixes bug 1323997

changelog
- pass unversioned.GroupResource to create instead of a string

- fix error messages for role/clusterrole as well

- fix gofmt error

- changed some types in the testing functions to the correct types
Comment 6 Troy Dawson 2016-10-27 12:29:02 EDT
This has been merged into ose and is in OSE v3.4.0.16 or newer.
Comment 8 zhaozhanqi 2016-12-19 00:26:25 EST
verified this bug on 
# openshift version
openshift v3.4.0.37+3b76456-1
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0


oadm router first
info: password for stats user admin has been set to 18ezc65RbX
--> Creating router first ...
    warning: serviceaccounts "router" already exists
    clusterrolebinding "router-first-role" created
    deploymentconfig "first" created
    service "first" created
--> Success
Comment 10 errata-xmlrpc 2017-01-18 07:39:40 EST
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/RHBA-2017:0066

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