Bug 2002897 - Rollback migration does not complete when the namespace contains a cron job
Summary: Rollback migration does not complete when the namespace contains a cron job
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: Controller
Version: 1.6.0
Hardware: Unspecified
OS: Unspecified
urgent
medium
Target Milestone: ---
: 1.6.0
Assignee: Jaydip Gabani
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-10 01:13 UTC by Jaydip Gabani
Modified: 2021-09-29 14:36 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-09-29 14:36:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github konveyor mig-controller pull 1200 0 None None None 2021-09-10 17:21:51 UTC
Github konveyor mig-controller pull 1202 0 None None None 2021-09-10 17:39:03 UTC
Red Hat Product Errata RHSA-2021:3694 0 None None None 2021-09-29 14:36:26 UTC

Description Jaydip Gabani 2021-09-10 01:13:44 UTC
Description of problem:
Rollback of a namespace that includes cronjobs gets stuck in "EnsureMigratedDeleted" phase

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


How reproducible:
source - 3.11 - release 1.5.1
destination - 4.7 - latest

Steps to Reproduce:
1.Create a cronjob using a pvc

oc new project bz-test


Create these resources in the new namespace

---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: "*/1 * * * *"
  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
          schedulerName: default-scheduler
          securityContext: {}
          terminationGracePeriodSeconds: 30
          volumes:
          - name: downloads
            persistentVolumeClaim:
              claimName: portal-downloads

---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: portal-downloads
  labels:
    app: cronjob
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 500Mi

2. Migrate the bz-test namespace using IDVM+IDIM
3. wait for one or two jobs to run and complete
4. Rollback 

Actual results:
The rollback deletes the CronJob but jobs are not deleted, corresponding completed pods are also present, volume is in a terminating state since the completed pods are present. The process is stuck

Expected results:
The rollback should succeed without getting stuck.

Additional info:

rollback migration status - 

status:
  conditions:
    - category: Advisory
      lastTransitionTime: '2021-09-10T01:05:47Z'
      message: 'Step: 8/10'
      reason: EnsureMigratedDeleted
      status: 'True'
      type: Running
    - category: Required
      lastTransitionTime: '2021-09-10T01:05:34Z'
      message: The migration is ready.
      status: 'True'
      type: Ready
  itinerary: Rollback
  observedDigest: 7d795bfe1696958632b3fe5778e9da31944b0972bc8914d7206ee9b1f92b0fa3
  phase: EnsureMigratedDeleted
  pipeline:
    - completed: '2021-09-10T01:05:34Z'
      message: Completed
      name: CleanupVelero
      started: '2021-09-10T01:05:34Z'
    - completed: '2021-09-10T01:05:35Z'
      message: Completed
      name: CleanupHelpers
      started: '2021-09-10T01:05:34Z'
    - message: Rolling back. Waiting for migrated resource deletion.
      name: CleanupMigrated
      phase: EnsureMigratedDeleted
      started: '2021-09-10T01:05:35Z'
    - message: Not started
      name: CleanupUnquiesce
    - message: Not started
      name: Cleanup

Comment 4 Xin jiang 2021-09-15 07:11:56 UTC
verified with MTC 1.6.0

registry.redhat.io/rhmtc/openshift-migration-controller-rhel8@sha256:3b5efa9c8197fe0313a2ab7eb184d135ba9749c9a4f0d15a6abb11c0d18b9194

Comment 6 errata-xmlrpc 2021-09-29 14:36:19 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 (Moderate: Migration Toolkit for Containers (MTC) 1.6.0 security & bugfix update), 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/RHSA-2021:3694


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