Bug 1368998 - Flags N/A for oc commands are shown in help info e.g. `oc extract -h` shows -o, --show-labels etc
Summary: Flags N/A for oc commands are shown in help info e.g. `oc extract -h` shows -...
Keywords:
Status: CLOSED EOL
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-22 10:02 UTC by XiaochuanWang
Modified: 2020-02-26 19:09 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-26 19:09:36 UTC
Target Upstream Version:


Attachments (Terms of Use)

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


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