Bug 1276564
Summary: | oc export will convert the file to v1 version when set --output-version to an invalid value | ||
---|---|---|---|
Product: | OKD | Reporter: | Yan Du <yadu> |
Component: | oc | Assignee: | Juan Vallejo <jvallejo> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Yan Du <yadu> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 3.x | CC: | aos-bugs, jvallejo, mmccomas, xxia |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-12-09 21:51:33 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Yan Du
2015-10-30 07:20:30 UTC
Hmm, "oc get" also has this problem with "--output-version" given invalid value. Related PR: https://github.com/openshift/origin/pull/11239 Updated PR to glog an info message any time versioned objects fail to be converted to the version specified: https://github.com/openshift/origin/pull/11239 Test on latest origin, still not show any warning info when --output-version set to invalid # oc version oc v1.4.0-alpha.1+64f88d7-121 kubernetes v1.4.0+776c994 [root@ip-172-18-11-67 ~]# oc get pod -o yaml --output-version=invalid apiVersion: v1 items: - apiVersion: v1 kind: Pod metadata: annotations: openshift.io/scc: anyuid creationTimestamp: 2016-11-09T02:27:36Z labels: name: hello-pod name: hello-pod namespace: default resourceVersion: "509" selfLink: /api/v1/namespaces/default/pods/hello-pod uid: 1434ae69-a624-11e6-b9f5-0ee10c50d580 spec: containers: - image: bmeng/hello-openshift imagePullPolicy: Always name: hello-pod resources: {} securityContext: capabilities: drop: - MKNOD - SYS_CHROOT privileged: false seLinuxOptions: level: s0:c5,c0 terminationMessagePath: /dev/termination-log volumeMounts: - mountPath: /var/run/secrets/kubernetes.io/serviceaccount name: default-token-qflf6 readOnly: true dnsPolicy: ClusterFirst imagePullSecrets: - name: default-dockercfg-fcebv nodeName: ip-172-18-11-67.ec2.internal restartPolicy: Always securityContext: seLinuxOptions: level: s0:c5,c0 serviceAccount: default serviceAccountName: default terminationGracePeriodSeconds: 30 volumes: - name: default-token-qflf6 secret: defaultMode: 420 secretName: default-token-qflf6 status: conditions: - lastProbeTime: null lastTransitionTime: 2016-11-09T02:27:36Z status: "True" type: Initialized - lastProbeTime: null lastTransitionTime: 2016-11-09T02:27:36Z message: 'containers with unready status: [hello-pod]' reason: ContainersNotReady status: "False" type: Ready - lastProbeTime: null lastTransitionTime: 2016-11-09T02:27:36Z status: "True" type: PodScheduled containerStatuses: - image: bmeng/hello-openshift imageID: "" lastState: {} name: hello-pod ready: false restartCount: 0 state: waiting: reason: ContainerCreating hostIP: 172.18.11.67 phase: Pending startTime: 2016-11-09T02:27:36Z kind: List metadata: {} yadu sorry about the confusion. The warning is printed in `--loglevel=1` or greater. Tried the command below and worked as expected: ``` $ oc get pod idling-echo-1-2x8kx -o yaml --output-version=invalid --loglevel=1 | head I1109 09:36:44.589247 2926 result.go:241] info: the output version specified is invalid. Defaulting to "v1" apiVersion: v1 kind: Pod metadata: annotations: kubernetes.io/created-by: | {"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicationController","namespace":"default","name":"idling-echo-1","uid":"8225fcde-a601-11e6-a78d-507b9dac96e1","apiVersion":"v1","resourceVersion":"71806"}} openshift.io/deployment-config.latest-version: "1" openshift.io/deployment-config.name: idling-echo openshift.io/deployment.name: idling-echo-1 openshift.io/scc: restricted ``` (In reply to Juan Vallejo from comment #5) > yadu sorry about the confusion. The warning is printed in > `--loglevel=1` or greater. Tried the command below and worked as expected: > > ``` > $ oc get pod idling-echo-1-2x8kx -o yaml --output-version=invalid > --loglevel=1 | head > I1109 09:36:44.589247 2926 result.go:241] info: the output version > specified is invalid. Defaulting to "v1" > apiVersion: v1 > kind: Pod > metadata: > annotations: > kubernetes.io/created-by: | > > {"kind":"SerializedReference","apiVersion":"v1","reference":{"kind": > "ReplicationController","namespace":"default","name":"idling-echo-1","uid": > "8225fcde-a601-11e6-a78d-507b9dac96e1","apiVersion":"v1","resourceVersion": > "71806"}} > openshift.io/deployment-config.latest-version: "1" > openshift.io/deployment-config.name: idling-echo > openshift.io/deployment.name: idling-echo-1 > openshift.io/scc: restricted > ``` # oc version oc v1.3.0-rc1+a24ab26-1350-dirty kubernetes v1.4.0+776c994 features: Basic-Auth Server https://10.13.137.149:8443 openshift v1.3.0-rc1 kubernetes v1.3.0+52492b4 Issue have been fixed. Move bug to verified. Thanks! # oc get pod -o yaml --output-version=invalid --loglevel=1 | head I1110 15:17:12.196785 8923 result.go:241] info: the output version specified is invalid. Defaulting to "v1" |