Bug 1828194 - Missing json output as an -o option for oc adm groups sync
Summary: Missing json output as an -o option for oc adm groups sync
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.1.z
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.5.0
Assignee: Maciej Szulik
QA Contact: RamaKasturi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-27 09:42 UTC by Maciej Szulik
Modified: 2020-07-13 17:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: During code refactoring printer flags were not wired properly. Consequence: Missing output options to oc adm group sync command. Fix: Wire printer flags. Result: All of the output options are working correctly.
Clone Of:
Environment:
Last Closed: 2020-07-13 17:31:52 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift oc pull 401 None closed Bug 1828194: wire printer flags to oc adm group sync 2020-06-30 16:21:06 UTC
Red Hat Product Errata RHBA-2020:2409 None None None 2020-07-13 17:32:09 UTC

Description Maciej Szulik 2020-04-27 09:42:30 UTC
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.

Comment 4 RamaKasturi 2020-04-30 15:51:44 UTC
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).

Comment 5 errata-xmlrpc 2020-07-13 17:31:52 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.

https://access.redhat.com/errata/RHBA-2020:2409


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