Bug 1476166

Summary: CLI returned the clusterrole was created, but actually it did not
Product: OpenShift Container Platform Reporter: Junqi Zhao <juzhao>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED ERRATA QA Contact: Junqi Zhao <juzhao>
Severity: low Docs Contact:
Priority: medium    
Version: 3.6.0CC: aos-bugs, jokerman, juzhao, jvallejo, mkhan, mmccomas, wsun
Target Milestone: ---   
Target Release: 3.7.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-28 22:05:56 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:    
Bug Blocks: Embargoed1440970, Embargoed1479989    

Description Junqi Zhao 2017-07-28 07:57:33 UTC
Description of problem:
Try to create clusterrole by command: 
oc create clusterrole hawkular-metrics --verb=get,list,watch --resource=namespaces

the command retruned the clusterrole was created, but actually it did not.

# oc create clusterrole hawkular-metrics --verb=get,list,watch --resource=namespaces
clusterrole "hawkular-metrics" created

# oc get clusterrole hawkular-metrics -o yaml
Error from server (NotFound): clusterrole.authorization.openshift.io "hawkular-metrics" not found

Version-Release number of selected component (if applicable):
# openshift version
openshift v3.
kubernetes v1.6.1+5115d708d7
etcd 3.2.1

How reproducible:

Steps to Reproduce:
1. oc create clusterrole hawkular-metrics --verb=get,list,watch --resource=namespaces
2. oc get clusterrole hawkular-metrics -o yaml

Actual results:
clusterrole "hawkular-metrics" did not create actually.

Expected results:
clusterrole "hawkular-metrics" should be created.

Additional info:

Comment 2 Juan Vallejo 2017-08-17 20:44:44 UTC
I was able to reproduce this bug using commit https://github.com/openshift/origin/commit/70ec58fe94923d8eba45fdeaa7abea147576086a

At least as of https://github.com/openshift/origin/commit/edf3ff5d466a3ffd2f99e9929952d285822443b9 (or latest master) this issue appears to be fixed.

$ oc version
oc v3.7.0-alpha.0+60f92ee-347-dirty
kubernetes v1.7.0+695f48a16f
features: Basic-Auth

openshift v3.7.0-alpha.0+60f92ee-347-dirty
kubernetes v1.7.0+695f48a16f

Adding Mo to cc list

Comment 3 Mo 2017-08-17 22:06:15 UTC
These commands will be disabled in 3.6 once https://github.com/openshift/origin/pull/15618 merges.  They worked as expected in 3.7 as of https://github.com/openshift/origin/pull/15021

Comment 5 Junqi Zhao 2017-10-09 09:05:25 UTC
Issue is fixed now, see the following output.

# oc create clusterrole hawkular-metrics --verb=get,list,watch --resource=namespaces
clusterrole "hawkular-metrics" created

# oc get clusterrole hawkular-metrics -o yaml
apiVersion: v1
kind: ClusterRole
  creationTimestamp: 2017-10-09T08:57:05Z
  name: hawkular-metrics
  resourceVersion: "16895"
  selfLink: /oapi/v1/clusterroles/hawkular-metrics
  uid: d31ce3c4-accf-11e7-b2b5-fa163e3f2b53
- apiGroups:
  - ""
  attributeRestrictions: null
  - namespaces
  - get
  - list
  - watch

# openshift version
openshift v3.7.0-0.126.6
kubernetes v1.7.0+80709908fd
etcd 3.2.1

Comment 8 errata-xmlrpc 2017-11-28 22:05:56 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.