Bug 1465344 - oc export does not output all fields contained in original template file
oc export does not output all fields contained in original template file
Status: CLOSED NOTABUG
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.2.0
All Linux
unspecified Severity low
: ---
: ---
Assigned To: Fabiano Franz
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-27 05:22 EDT by afox@redhat.com
Modified: 2017-10-24 16:19 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-10-24 16:19:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description afox@redhat.com 2017-06-27 05:22:39 EDT
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@eur.nsroot.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 17:46:27 EDT
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.