Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1420247 - Inconsistent message of web and CLI about adding role system:image-builder/system:deployer to serviceaccount of another project
Inconsistent message of web and CLI about adding role system:image-builder/sy...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console (Show other bugs)
3.5.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: bpeterse
Yadan Pei
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-02-08 04:46 EST by Yadan Pei
Modified: 2017-07-24 10 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-03-08 09:41:55 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:0884 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.5 RPM Release Advisory 2017-04-12 18:50:07 EDT

  None (edit)
Description Yadan Pei 2017-02-08 04:46:51 EST
Description of problem:
Inconsistence of web and CLI about adding role system:image-builder/system:deployer  to serviceaccount of another project

Version-Release number of selected component (if applicable):
v3.5.0.17+c55cf2b

How reproducible:
Always

Steps to Reproduce:
1.Create project 'test1' and 'test2'
2.Grant serviceaccount:builder in 'test1' with system:image-builder role to project 'test2'
Go to project 'test2' -> Membership -> Edit Membership -> Serviceaccounts tab -> Select test1/builder from Name -> Select system:image-builder from Role -> Click Add
3.Try to grant serviceaccount:builder in 'test1' with system:image-builder role to project 'test2' through CLI
$ oc policy add-role-to-user system:image-builder serviceaccount:test1:builder -n test2


Actual results:
2. Give message after clicking Add:
The role "system:image-builder" has already been granted to "builder"
3. Gives error message:
$ oc policy add-role-to-user system:image-builder serviceaccount:test1:builder -n test2
Error from server (Forbidden): rolebinding "system:image-builders" is forbidden: user "yapei" cannot grant extra privileges:
{Verbs:["update"], APIGroups:[""], Resources:["builds/details"]}

Expected results:
2. Web console should give error output since we didn't add role "system:image-builder" to "test1:builder" successfully, also the error message should keep consistent with CLI

Additional info:
system:image-puller and system:image-pusher have no this problem.
Giving system:image-builder to non-serviceaccount user has no this problem.


The same problems happens when adding role system:deployer to service account
CLI gives error message:
$ oc policy add-role-to-user system:deployer serviceaccount:test1:deployer -n test2
Error from server (Forbidden): rolebinding "system:deployers" is forbidden: user "yapei" cannot grant extra privileges:
{Verbs:["create"], APIGroups:[""], Resources:["events"]}

While web console return successful message:
The role "system:deployer" has already been granted to "deployer".
Comment 1 bpeterse 2017-02-08 10:36:39 EST
Agree, the following should be true:
- if current user does not have cluster-admin for the project, the system:image-builder should not be allowed to be granted (currently, cli is correct)
- if current user does have cluster-admin for this project, the role system:image-builder should be allowed to be granted.

PR coming to fix the web console shortly.
Comment 2 bpeterse 2017-02-08 10:50:57 EST
PR open to fix: https://github.com/openshift/origin-web-console/pull/1229
Comment 3 Troy Dawson 2017-02-10 17:53:13 EST
This has been merged into ocp and is in OCP v3.5.0.19 or newer.
Comment 5 XiaochuanWang 2017-02-12 20:52:06 EST
Verified on v3.5.0.19+199197c with original steps when user does not have cluster-admin role

When user does have cluster-admin role, web console shows 'The role "system:image-builder" was granted to "builder".' while CLI shows 'role "system:image-builder" added: "serviceaccount:test1:builder"'. Both could be accepted.

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