Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2012766

Summary: OC adm group sync generates an empty Item
Product: OpenShift Container Platform Reporter: Roman Hodain <rhodain>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED DUPLICATE QA Contact: zhou ying <yinzhou>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.8CC: aos-bugs, jokerman, mfojtik
Target Milestone: ---   
Target Release: ---   
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: 2021-10-11 11:57:38 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 Roman Hodain 2021-10-11 09:01:51 UTC
Description of problem:
When using `oc adm group sync` into a YAML file. The tool generates an empty item to the YAML file that prevents successful parsing later on. The `ac apply -f` does not work properly with this data and ends with non 0 return code.

Version-Release number of selected component (if applicable):
    4.8.13

How reproducible:
    100%

Steps to Reproduce:
    1. oc adm groups sync my_ldap_group --sync-config=sync-config.yaml -o yaml

Actual results:
    apiVersion: user.openshift.io/v1
    items:
    - metadata:
        creationTimestamp: null
      users: null
    - apiVersion: user.openshift.io/v1
      kind: Group
      metadata:
        annotations:
          openshift.io/ldap.sync-time: ...
          openshift.io/ldap.uid: ...

Expected results:
    Missing the first item that contains only null values.

Additional info:
    I believe that this was introduced with Bug 1936904

Comment 1 Maciej Szulik 2021-10-11 11:57:38 UTC

*** This bug has been marked as a duplicate of bug 1989391 ***