Bug 1368998

Summary: Flags N/A for oc commands are shown in help info e.g. `oc extract -h` shows -o, --show-labels etc
Product: OpenShift Container Platform Reporter: XiaochuanWang <xiaocwan>
Component: ocAssignee: Clayton Coleman <ccoleman>
Status: CLOSED EOL QA Contact: Xingxing Xia <xxia>
Severity: low Docs Contact:
Priority: medium    
Version: unspecifiedCC: aos-bugs, jokerman, maszulik, mmccomas
Target Milestone: ---Keywords: Reopened
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: 2020-02-26 19:09:36 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:

Description XiaochuanWang 2016-08-22 10:02:40 UTC
Description of problem:
Extract a secret to a file with -o flag will failed to output the correct format for the secret, only output the secret key and missed the value.

Version-Release number of selected component (if applicable):
oc v1.3.0-alpha.3+7b3e38d

How reproducible:
Always

Steps to Reproduce:
1. If there's no secret, create one with multiple data first.

2. Extract secret with different type of output
# oc extract secret/default-token-4dbjd  -o json
# oc extract secret/default-token-4dbjd  -o yaml --confirm 
# oc extract secret/default-token-4dbjd  -o wide --confirm 

Actual results:
Besides the 4 created file from secret data, terminal only outputs the keys of the secret no-matter what the type is given by `-o`
"""
service-ca.crt
token
ca.crt
namespace
"""

Expected results:
Besides the 4 created file from secret data, output should combine the data in correct format.

Additional info:
Refer to `oc run test1 --image=aos-qe/hello-openshift -o yaml`

Comment 1 XiaochuanWang 2016-08-23 07:08:28 UTC
Same flag also doesn't work for configmap
# oc create configmap myconfig --from-file=/openshift.local.config/master/master-config.yaml
# oc extract configmap/myconfig --confirm -o json
master-config.yaml
# oc extract configmap/myconfig --confirm -o yaml
master-config.yaml
# oc extract configmap/myconfig --confirm -o name
master-config.yaml
# oc extract configmap/myconfig --confirm -o wide
master-config.yaml
From `oc edit configmap myconfig` the format of "data" is yaml

Comment 2 Clayton Coleman 2018-04-30 17:58:22 UTC
This is working as designed.  Extract retrieves file contents, which can't be converted from types.

Comment 3 Xingxing Xia 2018-05-02 02:07:06 UTC
Thx, sounds good. Now that the flags (-o, --show-labels etc.) are N/A (not applicable) for oc extract, it is better to not show them in `oc extract -h`. Other sub-commands' help info may have similar issue of N/A flags