The following worked in 3.x. Does not work in 4.x $ oc adm groups sync -o json Error: unknown shorthand flag: 'o' in -o See 'oc adm groups sync --help' for usage.
Verified with the below version and i do not see any errors as mentioned in the description. Could see the same in the help as well: =========================================== [ramakasturinarra@dhcp35-60 OpenShift]$ oc adm groups sync --help Sync OpenShift Groups with records from an external provider. In order to sync OpenShift Group records with those from an external provider, determine which Groups you wish to sync and where their records live. For instance, all or some groups may be selected from the current Groups stored in OpenShift that have been synced previously, or similarly all or some groups may be selected from those stored on an LDAP server. The path to a sync configuration file is required in order to describe how data is requested from the external record store and migrated to OpenShift records. Default behavior is to do a dry-run without changing OpenShift records. Passing '--confirm' will sync all groups from the LDAP server returned by the LDAP query templates. Usage: oc adm groups sync [--type=TYPE] [WHITELIST] [--whitelist=WHITELIST-FILE] --sync-config=CONFIG-FILE [--confirm] [flags] Examples: # Sync all groups from an LDAP server oc adm groups sync --sync-config=/path/to/ldap-sync-config.yaml --confirm # Sync all groups except the ones from the blacklist file from an LDAP server oc adm groups sync --blacklist=/path/to/blacklist.txt --sync-config=/path/to/ldap-sync-config.yaml --confirm # Sync specific groups specified in a whitelist file with an LDAP server oc adm groups sync --whitelist=/path/to/whitelist.txt --sync-config=/path/to/sync-config.yaml --confirm # Sync all OpenShift Groups that have been synced previously with an LDAP server oc adm groups sync --type=openshift --sync-config=/path/to/ldap-sync-config.yaml --confirm # Sync specific OpenShift Groups if they have been synced previously with an LDAP server oc adm groups sync groups/group1 groups/group2 groups/group3 --sync-config=/path/to/sync-config.yaml --confirm Options: --allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. --blacklist='': path to the group blacklist file --confirm=false: if true, modify OpenShift groups; if false, display results of a dry-run -o, --output='yaml': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file. --sync-config='': path to the sync config --template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. --type='ldap': which groups white- and blacklist entries refer to: ldap,openshift --whitelist='': path to the group whitelist file Use "oc adm options" for a list of global command-line options (applies to all commands).
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-2020:2409