Bug 1740332
Summary: | OLM should install the operator for user defined Service Account for OperatorGroup after granting the proper permissions | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Bruno Andrade <bandrade> |
Component: | OLM | Assignee: | Evan Cordell <ecordell> |
OLM sub component: | OLM | QA Contact: | Bruno Andrade <bandrade> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | medium | ||
Priority: | medium | CC: | akashem, chuo, jfan, jiazha, scolange |
Version: | 4.2.0 | ||
Target Milestone: | --- | ||
Target Release: | 4.2.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-10-16 06:35:39 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: | |
Embargoed: |
Description
Bruno Andrade
2019-08-12 17:05:06 UTC
Yes, this is a known issue. If you recreate the subscription the operator will install successfully. I have created a corresponding JIRA issue here - https://jira.coreos.com/browse/OLM-1244. LGTM, Marking as VERIFIED. Steps used to validate: 1. Create the namespace test-operators oc create ns test-operators 2. Create a service account oc create sa scoped -n test-operators 3. Create the Operator Group schema oc create -f - <<EOF apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: test-operators-og namespace: test-operators spec: serviceAccountName: scoped targetNamespaces: - test-operators EOF 4. Create the Configmap and the CatalogSource oc create -f https://raw.githubusercontent.com/bandrade/v3-testfiles/v4.1/olm/configmap/configmap_etcd.yaml -n openshift-marketplace oc create -f https://raw.githubusercontent.com/bandrade/v3-testfiles/v4.1/olm/catalogsource/catalogsource.yaml -n openshift-marketplace 5. Create the Subscription, as below: oc create -f https://raw.githubusercontent.com/bandrade/v3-testfiles/v4.1/olm/subscription/test.yaml -n test-operators It's expected that csv installation fails due to the missing permissions of the scoped service account. oc get csv -n test-operators No resources found. oc get ip -n test-operators NAME CSV SOURCE APPROVAL APPROVED install-xkhjm etcdoperator.v0.9.2 Automatic true oc get ip install-xkhjm -n test-operators -o yaml | grep -A 10 "conditions:" conditions: - lastTransitionTime: "2019-08-27T17:40:16Z" lastUpdateTime: "2019-08-27T17:41:23Z" message: 'error creating csv etcdoperator.v0.9.2: clusterserviceversions.operators.coreos.com is forbidden: User "system:serviceaccount:test-operators:scoped" cannot create resource "clusterserviceversions" in API group "operators.coreos.com" in the namespace "test-operators"' reason: InstallComponentFailed status: "False" type: Installed phase: Failed 6. Grant the proper permissions to the service account oc create -f - <<EOF apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: scoped namespace: test-operators rules: - apiGroups: ["*"] resources: ["*"] verbs: ["*"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: scoped-bindings namespace: test-operators roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: scoped subjects: - kind: ServiceAccount name: scoped namespace: test-operators EOF 7- At this time, the csv should be installed successfully oc get csv -n test-operators NAME DISPLAY VERSION REPLACES PHASE etcdoperator.v0.9.2 etcd 0.9.2 Succeeded ---- Cluster Details: Cluster Version: oc get clusterversion -o json|jq ".items[0].status.history[0].version" "4.2.0-0.nightly-2019-08-26-235330" OLM Version: oc exec olm-operator-bcbb85b76-wwn7w -n openshift-operator-lifecycle-manager -- olm -version OLM version: 0.11.0 git commit: 414ead11612825cabf3fb44323b7018af04ada14 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:2922 |