Bug 1542238 - oc get of imagestream with --export option changes the namespace
Summary: oc get of imagestream with --export option changes the namespace
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.9.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 3.9.0
Assignee: Juan Vallejo
QA Contact: Mike Fiedler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-05 21:32 UTC by Mike Fiedler
Modified: 2018-03-28 14:26 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-28 14:25:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
oc get -o yaml --loglevel=8 --export -n openshift imagestream jenkins > oc_export_is.out 2>&1 (4.50 KB, text/plain)
2018-02-07 16:57 UTC, Mike Fiedler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0489 0 None None None 2018-03-28 14:26:08 UTC

Description Mike Fiedler 2018-02-05 21:32:17 UTC
Description of problem:

oc get -o yaml --export -n openshift imagestream jenkins 

returns yaml with namespace: default.   --export generally should not return a namespace.

root@ip-172-31-36-114: ~/svt/conformance # oc get -n openshift -o yaml --export is/jenkins | less
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  annotations:
    openshift.io/display-name: Jenkins
    openshift.io/image.dockerRepositoryCheck: 2018-02-05T13:04:24Z
  creationTimestamp: null
  generation: 1
  name: jenkins
  namespace: default
  selfLink: /apis/image.openshift.io/v1/namespaces/default/imagestreams/jenkins


Leaving --export off returns the correct namespace:

root@ip-172-31-36-114: ~/svt/conformance # oc get -n openshift -o yaml  is/jenkins | less                                                                                                                                                                                                 
apiVersion: image.openshift.io/v1                                                                                                                                                                                                                                                         
kind: ImageStream                                                     
metadata:                                                             
  annotations:                                                        
    openshift.io/display-name: Jenkins                                
    openshift.io/image.dockerRepositoryCheck: 2018-02-05T13:04:24Z    
  creationTimestamp: 2018-02-05T13:04:19Z                             
  generation: 2                                                       
  name: jenkins                                                       
  namespace: openshift                                                
  resourceVersion: "890"                                              
  selfLink: /apis/image.openshift.io/v1/namespaces/openshift/imagestreams/jenkins                                                            
  uid: 13b81fe9-0a75-11e8-af2c-022c90aeb698                           



Version-Release number of selected component (if applicable): 3.9.0-0.36.0


How reproducible: Always


Steps to Reproduce:
1. Install 3.9.0-0.36.0 using openshift-ansible
2. See above for commands

Actual results:

yaml output when --export option is specified contains incorrect namespaces

Expected results:

Correct yaml that can be used to replace a resource.

Comment 1 Juan Vallejo 2018-02-06 23:03:10 UTC
Able to reproduce this on a 3.9 client against a 3.9 server.

Origin PR: https://github.com/openshift/origin/pull/18487

Comment 2 Juan Vallejo 2018-02-07 16:12:18 UTC
@mifiedler can you post the version of the client that you are using?
Also, could you provide the --loglevel=8 output of `oc get -n openshift -o yaml --export`?

Comment 3 Mike Fiedler 2018-02-07 16:57:19 UTC
Originally reported with client 3.6.0-0.36.0.   Reproduced below with 3.6.0-0.38.0 and loglevel=8

# oc version
oc v3.9.0-0.38.0
kubernetes v1.9.1+a0ce1bc657
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://ip-172-31-0-243.us-west-2.compute.internal:8443
openshift v3.9.0-0.38.0
kubernetes v1.9.1+a0ce1bc657

# oc get -o yaml --loglevel=8 --export -n openshift imagestream jenkins  > oc_export_is.out 2>&1


Output attached.

Comment 4 Mike Fiedler 2018-02-07 16:57:36 UTC
Created attachment 1392784 [details]
oc get -o yaml --loglevel=8 --export -n openshift imagestream jenkins  > oc_export_is.out 2>&1

Comment 5 Mike Fiedler 2018-02-07 17:00:28 UTC
Current namespace for repro in comment 4 was "logging"

Comment 7 Juan Vallejo 2018-02-15 22:37:57 UTC
Origin PR [1] merged. Moving to ON_QA

Comment 8 Mike Fiedler 2018-02-15 22:46:51 UTC
Moving to MODIFIED until a puddle with the change is available.

Comment 10 Mike Fiedler 2018-02-21 15:17:11 UTC
Verified on 3.9.0-0.47.0 - namespace not present when --export used.

root@ip-172-31-15-225: ~ # oc get is -n openshift -o yaml --export jenkins 
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  annotations:
    openshift.io/display-name: Jenkins
    openshift.io/image.dockerRepositoryCheck: 2018-02-21T14:48:26Z
  creationTimestamp: null
  generation: 1
  name: jenkins
  selfLink: /apis/image.openshift.io/v1/namespaces/openshift/imagestreams/jenkins

<snip>

Comment 13 errata-xmlrpc 2018-03-28 14:25:43 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-2018:0489


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