Bug 1393230 - oc convert didn't create all files under directory after they have been converted
Summary: oc convert didn't create all files under directory after they have been conve...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-09 06:35 UTC by Yadan Pei
Modified: 2017-03-08 18:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: 'oc convert' failed to produce a YAML file with valid syntax when converting from multiple files in a directory. Consequence: When converting from multiple files in a directory and piping the output to 'oc create', it would only create the first file converted. Fix: Fixed the YAML syntax in the output of 'oc convert' when converting multiple files. Result: The output of 'oc convert' can feed 'oc create' properly.
Clone Of:
Environment:
Last Closed: 2017-01-18 12:51:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 17:23:26 UTC

Description Yadan Pei 2016-11-09 06:35:00 UTC
Description of problem:
oc convert didn't create all files under directory after they have been converted

Version-Release number of selected component (if applicable):
oc v3.4.0.23+24b1a58
kubernetes v1.4.0+776c994

How reproducible:
Always

Steps to Reproduce:
1.Prepare 2 test files
cat >> job-v1.yaml << EOF
apiVersion: batch/v1
kind: Job
metadata:
  name: pi
spec:
  template:
    metadata:
      name: pi
    spec:
      containers:
      - name: pi
        image: perl
        command: ["perl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]
      restartPolicy: Never
EOF

cat >> job-v2.json << EOF
{
    "kind": "ScheduledJob",
    "apiVersion": "batch/v2alpha1",
    "metadata": {
        "name": "hello",
        "creationTimestamp": null
    },
    "spec": {
        "schedule": "0/1 * * * ?",
        "concurrencyPolicy": "Allow",
        "suspend": false,
        "jobTemplate": {
            "metadata": {
                "creationTimestamp": null
            },
            "spec": {
                "template": {
                    "metadata": {
                        "creationTimestamp": null
                    },
                    "spec": {
                        "containers": [
                            {
                                "name": "hello",
                                "image": "busybox",
                                "args": [
                                    "/bin/sh",
                                    "-c",
                                    "date; echo Hello from the Kubernetes cluster"
                                ],
                                "resources": {},
                                "terminationMessagePath": "/dev/termination-log",
                                "imagePullPolicy": "Always"
                            }
                        ],
                        "restartPolicy": "OnFailure",
                        "terminationGracePeriodSeconds": 30,
                        "dnsPolicy": "ClusterFirst",
                        "securityContext": {}
                    }
                }
            }
        }
    },
    "status": {}
}
EOF
2.mkdir /tmp/test; cp job-v1.yaml job-v2.json /tmp/test;cd /tmp/test
3.oc convert -f .
4.oc convert -f . | oc create -f -

Actual results:
3.All files are converted
4.Only one resource is created
$ oc convert -f . | oc create -f -
running in local mode...
scheduledjob "hello" created

Expected results:
4. Both job "pi" and scheduledjob "hello" should be created successfully

Additional info:

Comment 1 Fabiano Franz 2016-11-11 18:36:10 UTC
Fixed in https://github.com/openshift/origin/pull/11874.

Comment 2 Yadan Pei 2016-11-17 09:33:44 UTC
Checked with oc v3.4.0.27+dffa95c/kubernetes v1.4.0+776c994 with steps in "Steps to Reproduce", issue has been fixed

I could verify when it's moved ON_QA

Comment 3 Yadan Pei 2016-11-18 02:50:45 UTC
Move to VERIFIED since already checked in oc v3.4.0.27

Comment 5 errata-xmlrpc 2017-01-18 12:51:06 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-2017:0066


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