Bug 1465344 - oc export does not output all fields contained in original template file
Summary: oc export does not output all fields contained in original template file
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.2.0
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-27 09:22 UTC by afox@redhat.com
Modified: 2020-12-14 08:57 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-24 20:19:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description afox@redhat.com 2017-06-27 09:22:39 UTC
Description of problem:

template file contains this:
[...]
- description: Full image name
  name: IMAGE_FULL_NAME
  value: docker-icg-dev-local.artifactrepository.citigroup.net/tts-icg-vam-flexcube-40006/vam-flexcube:latest
- description: OpenShift sercret name where connection passwords are stored.
  name: SECRET
  required: true
  value: app-secrets-def
message: "test message"

This (message:) is not visible in export:

$ oc export template/flexcube-vam
apiVersion: v1
kind: Template
metadata:
  annotations:
    maven.fabric8.io/app-catalog: "true"
[...]
- description: OpenShift sercret name where connection passwords are stored.
  name: SECRET
  required: true
  value: app-secrets-def
[ds68515.net@sd-10eb-7869 VAMopenshift]$

Similarly, with secrets: 
$ oc create secret generic vam-flexcube-tibco-def --from-file=emsca=EMSCA.pem --from-file=flxc-165780=FLXC_165780.p12 
Add the keys to deployment config template: 
$ oc edit dc/template-test 
[...] 
        - 
          name: tibco-cert-volume 
          secret: 
            secretName: vam-flexcube-tibco-def2 
              - {key: emsca, path: EMSCA.pem} 
              - {key: flxc-165780, path: FLXC_165780.p12} 
[...] 

Subsequent export doesn't show the keys: 
$ oc export dc/template-test 
[...] 
        - 
          name: tibco-cert-volume 
          secret: 
            secretName: vam-flexcube-tibco-def2 
  test: false 
  triggers: 
  - type: ConfigChange 
status: {}

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

How reproducible:
Every time

Actual results:
Fields are missing in export

Expected results:
Fields present in original template should be present in export

Comment 1 Juan Vallejo 2017-10-17 21:46:27 UTC
I believe this is how the command is actually meant to work. If you wish to export without any modifications to a resource, either use the --exact or --raw flags


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