Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1366529 - [infrastructure_public_316] Cannot extract configmap/secret if without "--to" option
Summary: [infrastructure_public_316] Cannot extract configmap/secret if without "--to"...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Command Line Interface
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-12 09:06 UTC by Zhang Cheng
Modified: 2016-09-19 13:54 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-19 13:54:08 UTC


Attachments (Terms of Use)

Description Zhang Cheng 2016-08-12 09:06:03 UTC
[CLI] Cannot extract configmap/secret if without --to option
M
M


Description of problem: Cannot extract configmap/secret if without --to option


Version-Release number of selected component (if applicable):
oc v3.3.0.18
kubernetes v1.3.0+507d3a7
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://10.14.6.167:8443
openshift v3.3.0.18
kubernetes v1.3.0+507d3a7


How reproducible:
Always


Steps to Reproduce:
1. Prepare a file secret.yaml
$ cat secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: test-secret
data:
  data-1: dmFsdWUtMQ0K
  data-2: dmFsdWUtMg0KDQo=

2. Extract secret from a file:
$ oc extract -f secret.yaml

3. Create the secret:
$ oc create -f secret.yaml
secret "test-secret" created

4. Extract secret from a created secret
$ oc extract secret/test-secret 

Actual results: Can get key/value via "oc exec -it $pod", but cannot get value via "oc env pods"
2. Extract secret from a file:
$ oc extract -f secret.yaml
error: stat : no such file or directory

4. Extract secret from a created secret
$ oc extract secret/test-secret 
error: stat : no such file or directory


Expected results: 
2. Extract secret from a file: The secret can be extract succeed
4. Extract secret from a created secret: The secret can be extract succeed


addition info: 
Can extract secret/configmap successful with "--to" option:
$ oc extract -f secret.yaml --to=./
data-2
data-1
$ oc extract secret/test-secret --to=/tmp
/tmp/data-1
/tmp/data-2

Comment 1 Zhang Cheng 2016-08-12 09:21:07 UTC
It should be included by bug: https://bugzilla.redhat.com/show_bug.cgi?id=1360652

Comment 2 Clayton Coleman 2016-08-16 22:01:05 UTC
https://github.com/openshift/origin/pull/10468

Comment 3 Zhang Cheng 2016-08-17 01:39:07 UTC
Fix didn't check in, I will verify this bug till above pr is merged.

Comment 4 Zhang Cheng 2016-08-19 10:13:35 UTC
Verified with openshift origin latest code.
[root@ip-172-18-15-76 ~]# oc version
oc v1.3.0-alpha.3+e5178ec-dirty
kubernetes v1.3.0+507d3a7
features: Basic-Auth

Server https://172.18.15.76:8443
openshift v1.3.0-alpha.3+e5178ec-dirty
kubernetes v1.3.0+507d3a7
[root@ip-172-18-15-76 ~]# openshift version
openshift v1.3.0-alpha.3+e5178ec-dirty
kubernetes v1.3.0+507d3a7
etcd 2.3.0+git

Test passed for these three TCs: https://goo.gl/3y9yjK


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