Bug 1612628

Summary: In some error, `oc get` should remove the message No resources found
Product: OpenShift Container Platform Reporter: zhou ying <yinzhou>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: low Docs Contact:
Priority: medium    
Version: 3.11.0CC: aos-bugs, ffranz, jokerman, maszulik, mmccomas, pweil, wmeng, xiaocwan, xxia, yanpzhan
Target Milestone: ---Keywords: Rebase, UpcomingRelease
Target Release: 4.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: There was no proper error check when returning no resources information. Consequence: No resources found was always printed. Fix: Check other errors before printing no resources found. Result: No resources found is printed only when no other errors were encountered.
Story Points: ---
Clone Of: 1393289 Environment:
Last Closed: 2019-06-04 10:40:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1393289    
Bug Blocks:    

Comment 1 Juan Vallejo 2018-08-08 14:29:00 UTC
Looks like a regression. Upstream PR: https://github.com/kubernetes/kubernetes/pull/67137

Will make it into Origin in the next rebase.

Comment 2 Juan Vallejo 2018-08-16 19:06:21 UTC
Upstream PR has merged. Fix will be available in Origin after the next rebase.

Comment 4 Maciej Szulik 2019-02-28 15:42:54 UTC
This has merged with the rebase, moving to qa.

Comment 5 zhou ying 2019-03-01 02:32:29 UTC
The issue has fixed:
[root@dhcp-140-138 ~]# oc version --short
Client Version: v4.0.6
Server Version: v1.12.4+0cbcfc5afe
[root@dhcp-140-138 ~]# oc get users
Error from server (Forbidden): users.user.openshift.io is forbidden: User "pm1" cannot list resource "users" in API group "user.openshift.io" at the cluster scope
[root@dhcp-140-138 ~]# oc get users --loglevel=6
I0301 10:32:00.953222   15895 loader.go:359] Config loaded from file /root/.kube/config
I0301 10:32:00.954370   15895 loader.go:359] Config loaded from file /root/.kube/config
I0301 10:32:00.957514   15895 loader.go:359] Config loaded from file /root/.kube/config
I0301 10:32:00.963325   15895 loader.go:359] Config loaded from file /root/.kube/config
I0301 10:32:01.979722   15895 round_trippers.go:405] GET https://api.qe-yinzhou.qe.devcluster.openshift.com:6443/apis/user.openshift.io/v1/users?limit=500 403 Forbidden in 1016 milliseconds
I0301 10:32:01.980232   15895 helpers.go:201] server response object: [{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "users.user.openshift.io is forbidden: User \"pm1\" cannot list resource \"users\" in API group \"user.openshift.io\" at the cluster scope",
  "reason": "Forbidden",
  "details": {
    "group": "user.openshift.io",
    "kind": "users"
  },
  "code": 403
}]
F0301 10:32:01.980275   15895 helpers.go:119] Error from server (Forbidden): users.user.openshift.io is forbidden: User "pm1" cannot list resource "users" in API group "user.openshift.io" at the cluster scope

Comment 8 errata-xmlrpc 2019-06-04 10:40:34 UTC
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-2019:0758