Bug 1985125 - OperatorGroup status is not updated when it has cardinality conflits when targetNamespace is used
Summary: OperatorGroup status is not updated when it has cardinality conflits when tar...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.9
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.9.0
Assignee: Vu Dinh
QA Contact: Bruno Andrade
URL:
Whiteboard:
: 1985129 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-22 23:15 UTC by Bruno Andrade
Modified: 2021-10-18 17:41 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:40:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift operator-framework-olm pull 148 0 None None None 2021-08-03 18:22:56 UTC
Github operator-framework operator-lifecycle-manager pull 2305 0 None open Bug 1985125: fix(og): Fix missing MultiOperatorGroups condition in some cases 2021-07-30 02:55:33 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:41:03 UTC

Description Bruno Andrade 2021-07-22 23:15:06 UTC
Description of problem:

OperatorGroup status should be updated when targetNamespace is used.


Version-Release number of selected component (if applicable):
4.9.0-0.nightly-2021-07-21-081948
OLM version: 0.18.3
git commit: 1dc76f08ed05a635458420ffa979aebbe59a3890


How reproducible:
Always

Steps to Reproduce:
1. Create two namespaces test and test-1
2. Create an OperatorGroup with targetNamespaces for test and test-1, as below:
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: og-group
  namespace: test
spec:
  targetNamespaces:
  - test
  - test-1



3. Create a second Operator in test-1 namespace with only test-1 as targetNamespaces.

apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: og-group-1
  namespace: test-1
spec:
  targetNamespaces:
  - test-1

Actual results:

The status of the OperatorGroup does not have the conflict reported:

oc get og og-group -o yaml -n test    
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  creationTimestamp: "2021-07-22T23:01:21Z"
  generation: 1
  name: og-group
  namespace: test
  resourceVersion: "582376"
  uid: 3e94a5ba-861d-4782-acdd-18e741b41602
spec:
  targetNamespaces:
  - test
  - test-1
status:
  lastUpdated: "2021-07-22T23:01:21Z"
  namespaces:
  - test
  - test-1



oc get og og-group-1 -o yaml -n test-1                                                             
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  creationTimestamp: "2021-07-22T23:02:07Z"
  generation: 1
  name: og-group-1
  namespace: test-1
  resourceVersion: "582731"
  uid: 552cb9c7-8004-4893-bd03-87a779632d9d
spec:
  targetNamespaces:
  - test-1
status:
  lastUpdated: "2021-07-22T23:02:07Z"
  namespaces:
  - test-1


Expected results:
It should have added MultipleOperatorGroupsFound error in both

Additional info:

Comment 1 Vu Dinh 2021-07-30 01:11:39 UTC
*** Bug 1985129 has been marked as a duplicate of this bug. ***

Comment 4 Bruno Andrade 2021-08-05 00:03:40 UTC
Still not fail when an OperatorGroup covers more than one targetNamespace. Moving back to assigned for developer review.

oc exec catalog-operator-5b746cd5b7-bcbxj  -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.18.3
git commit: 552292e080289112aa03776b6e1f3957e72d46b3
OCP: 4.9.0-0.nightly-2021-08-04-131508


oc get og og-group -o yaml -n test  
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  creationTimestamp: "2021-08-04T23:45:11Z"
  generation: 1
  name: og-group
  namespace: test
  resourceVersion: "41280"
  uid: df5b8d55-ef63-4c7c-b3c2-9f830508c605
spec:
  targetNamespaces:
  - test
  - test-1
status:
  lastUpdated: "2021-08-04T23:45:11Z"
  namespaces:
  - test
  - test-1

oc get og og-group-1 -o yaml -n test-1                                                             
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  creationTimestamp: "2021-08-04T23:47:01Z"
  generation: 1
  name: og-group-1
  namespace: test-1
  resourceVersion: "42137"
  uid: e722a981-2b8a-4f7a-9fab-65029e669522
spec:
  targetNamespaces:
  - test-1
status:
  lastUpdated: "2021-08-04T23:47:01Z"
  namespaces:
  - test-1

Comment 5 Vu Dinh 2021-08-05 04:44:36 UTC
Hi Bruno,

I tested on 4.9.0-0.ci-2021-08-05-033855 and it works fine. I just noticed you created 2 operatorgroups in 2 different namespaces (test and test-1). They need to be in the same namespace to see this error.

Vu

Comment 8 Bruno Andrade 2021-08-05 14:51:38 UTC
Thanks, marking as VERIFIED.

OLM version: 0.18.3
git commit: 552292e080289112aa03776b6e1f3957e72d46b3
OCP: 4.9.0-0.nightly-2021-08-04-131508


1) Create a namespace called test 
oc create ns test

2) Create one OperatorGroup
cat og.yaml
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: og-group
  namespace: test
spec:
  targetNamespaces:
  - test

oc create -f og.yaml 

3) Check OperatorGroup status

oc get og og-group -o yaml -n test  

apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  creationTimestamp: "2021-07-22T21:36:59Z"
  generation: 1
  name: og-group
  namespace: test
  resourceVersion: "543701"
  uid: 056435fc-345c-4db3-ab3c-d64bc4c4ffec
spec:
  targetNamespaces:
  - test
status:
  lastUpdated: "2021-07-22T21:36:59Z"
  namespaces:
  - test

4) Create a second OperatorGroup

cat og1.yaml
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: og-group-1
  namespace: test
spec:
  targetNamespaces:
  - test

oc create -f og1.yaml         

An error should be reported in status:

oc get og og-group -o yaml -n test                                                                                                                    
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  creationTimestamp: "2021-07-22T21:36:59Z"
  generation: 1
  name: og-group
  namespace: test
  resourceVersion: "543108"
  uid: 056435fc-345c-4db3-ab3c-d64bc4c4ffec
spec:
  targetNamespaces:
  - test
status:
  conditions:
  - lastTransitionTime: "2021-07-22T21:37:14Z"
    message: Multiple OperatorGroup found in the same namespace
    reason: MultipleOperatorGroupsFound
    status: "True"
    type: MultipleOperatorGroup
  lastUpdated: "2021-07-22T21:36:59Z"
  namespaces:
  - test


oc get og og-group-1 -o yaml -n test
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  creationTimestamp: "2021-07-22T21:37:14Z"
  generation: 1
  name: og-group-1
  namespace: test
  resourceVersion: "543110"
  uid: e85860f8-e961-4695-898f-1bf6729f2f36
spec:
  targetNamespaces:
  - test
status:
  conditions:
  - lastTransitionTime: "2021-07-22T21:37:14Z"
    message: Multiple OperatorGroup found in the same namespace
    reason: MultipleOperatorGroupsFound
    status: "True"
    type: MultipleOperatorGroup
  lastUpdated: "2021-07-22T21:37:14Z"
  namespaces:
  - test

Comment 11 errata-xmlrpc 2021-10-18 17:40:51 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 (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), 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/RHSA-2021:3759


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