Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1393230 - oc convert didn't create all files under directory after they have been converted
oc convert didn't create all files under directory after they have been conve...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.4.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fabiano Franz
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-09 01:35 EST by Yadan Pei
Modified: 2017-03-08 13 EST (History)
4 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-18 07:51:06 EST
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 12:23:26 EST

  None (edit)
Description Yadan Pei 2016-11-09 01:35:00 EST
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 13:36:10 EST
Fixed in https://github.com/openshift/origin/pull/11874.
Comment 2 Yadan Pei 2016-11-17 04:33:44 EST
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-17 21:50:45 EST
Move to VERIFIED since already checked in oc v3.4.0.27
Comment 5 errata-xmlrpc 2017-01-18 07:51:06 EST
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.