Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1831252

Summary: cronjob does not work after migration because pvc is not copied
Product: OpenShift Container Platform Reporter: John Matthews <jmatthew>
Component: Migration ToolingAssignee: Scott Seago <sseago>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.3.zCC: jlee, mberube, rjohnson, sregidor, xjiang
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1822366 Environment:
Last Closed: 2020-09-30 18:42:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1822366    

Description John Matthews 2020-05-04 18:21:48 UTC
+++ This bug was initially created as a clone of Bug #1822366 +++

Description of problem:

Migration tool does not copy PVC that the cronjob uses so target cronjob does not work with the messages:
~~~
79s         Normal    SuccessfulCreate                 job/refresh-pq-1586368080                  Created pod: refresh-pq-1586368080-p2w8m
<unknown>   Warning   FailedScheduling                 pod/refresh-pq-1586368140-m45g6            persistentvolumeclaim "portal-downloads" not found
~~~

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


How reproducible:


Steps to Reproduce:
1. create a sample cronjob on source cluster
2. migrate 
3. execute the cronjob 

sample cronjob.
~~~
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: "30 3 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            args:
            - /bin/sh
            - -c
            - date; echo Hello from a CronJob
          restartPolicy: OnFailure
          volumeMounts:
            - mountPath: /downlods
              name: downloads
          dnsPolicy: ClusterFirst
          restartPolicy: OnFailure
          schedulerName: default-scheduler
          securityContext: {}
          terminationGracePeriodSeconds: 30
          volumes:
          - name: downloads
            persistentVolumeClaim:
              claimName: portal-downloads
~~~
Actual results:
Cronjob always becomes suspended status.

Expected results:
it should work.

Additional info:

--- Additional comment from John Matthews on 2020-04-08 21:52:58 UTC ---

Related to:  https://issues.redhat.com/browse/MIG-179

Comment 1 Scott Seago 2020-05-14 14:38:19 UTC
Fixed by https://github.com/konveyor/mig-controller/pull/485

Comment 4 Sergio 2020-09-17 09:39:11 UTC
Verified using MTC 1.3 stage
SOURCE CLUSTER: Azure 4.2
TARGET CLUSTER: Azure 4.5
Replication repository: Azure

Verified executing testcase "OCP-32189 - Migrate a cornjob attached PVC"

Moved to VERIFIED status.

Comment 8 errata-xmlrpc 2020-09-30 18:42:29 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 (Migration Toolkit for Containers (MTC) Tool image release advisory 1.3.0), 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-2020:4148