Bug 1761931

Summary: Cronjobs are not migrated because the version 'batch/v2alpha1' used on source cluster does not exist on destination cluster.
Product: Migration Toolkit for Containers Reporter: Sergio <sregidor>
Component: GeneralAssignee: John Matthews <jmatthew>
Status: CLOSED DEFERRED QA Contact: Xin jiang <xjiang>
Severity: high Docs Contact: Avital Pinnick <apinnick>
Priority: high    
Version: 1.3.0CC: chezhang, dgrigore, ernelson, jmatthew, rpattath, xjiang
Target Milestone: ---   
Target Release: 1.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-08 02:45:35 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:
Attachments:
Description Flags
log files, bucket backup and bucket restore-logs none

Description Sergio 2019-10-15 15:51:52 UTC
Created attachment 1626028 [details]
log files, bucket backup and bucket restore-logs

Description of problem:
When a migration from 3.7 to 4.2 is performed, cronjobs are not migrated.


Version-Release number of selected component (if applicable):
OCP4
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.2.0-0.nightly-2019-10-11-230724   True        False         33h     Cluster version is 4.2.0-0.nightly-2019-10-11-230724

OCP3
oc v3.7.126
kubernetes v1.7.6+a08f5eeb62
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://
openshift v3.7.126
kubernetes v1.7.6+a08f5eeb62


Controller Image:
openshift-migration-controller-rhel8:v1.0
openshift-migration-controller-rhel8@sha256:46c622e0fbe64165b09930738a7d111c875976b54c8236ddce328cb5470d60ab

Velero Images:
openshift-migration-velero-rhel8:v1.0
openshift-migration-velero-rhel8@sha256:bc0de9d8edcec4d2ca111c8f73e52a558e44619e2a592aefff7224895a55b4d0
openshift-migration-plugin-rhel8:v1.0
openshift-migration-plugin-rhel8@sha256:3f0f4c2efb27788f74b72a4bc1f526dc5b4637a67478030df64e5d792fe99511


How reproducible:
Always

Steps to Reproduce:
1.Create a namespace 
  oc new-project cronjob-test

2.Create an internal image
  oc import-image intalpine:int --from=docker.io/alpine:latest --confirm

3.Create a cronjob using a external image
 oc process -f https://raw.githubusercontent.com/sergiordlr/temp-testfiles/master/app_migration/cronjob/3.7/hello_cron_template.yml -p CRON_NAME=external-img -p IMAGE=docker.io/alpine | oc create -f -

4.Create a cron that uses this internal image
  oc process -f https://raw.githubusercontent.com/sergiordlr/temp-testfiles/master/app_migration/cronjob/3.7/hello_cron_template.yml -p CRON_NAME=internal-img -p IMAGE=docker-registry.default.svc:5000/cronjob-test/intalpine:int | oc create -f -
cronjob.batch/internal-img created

5. Migrate the namespace



Actual results:
The external image imagestream is migrated. But the cronjobs are not.
$ oc get cronjobs -n cronjob-test
No resources found.



Expected results:
Both cronjobs should be migrated and work fine in the OCP4 target cluster.

Additional info:
All logs are included in the attached file, as well as the bucket backup and the bucket restore-logs files.

Comment 2 John Matthews 2020-01-13 20:57:23 UTC
Our understanding of the problem is that the source is using a CronJob version of "batch/v2alpha1"
This has changed and is no longer available in the OCP 4 destination cluster.

We don't have a means of identifying or fixing this issue yet, planning to look into how we can detect these problems and fix in future.

For now moving this bug to a future release as it won't make our CAM 1.1.0 release (timeframe of OCP 4.3.).

Comment 3 John Matthews 2020-03-28 15:23:13 UTC
Tracking this as a larger feature for allow auto conversion of older api versions to newer/supported versions.
See:  https://issues.redhat.com/browse/MIG-168

Comment 4 Erik Nelson 2021-04-08 02:45:35 UTC
Closing as this should be captured by the larger RFE for allowing auto conversion of auto apis.