Bug 1882409

Summary: cancel migration dosen't stop the Job pod that is used to execute hook script
Product: Migration Toolkit for Containers Reporter: Xin jiang <xjiang>
Component: GeneralAssignee: Padmanabha V Seshadri <pseshadr>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact: Avital Pinnick <apinnick>
Priority: medium    
Version: 1.3.0CC: chezhang, ernelson, jmatthew, pseshadr, rjohnson, sregidor, whu
Target Milestone: ---Keywords: WorkItem
Target Release: 1.4.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-02-11 12:54:46 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:

Description Xin jiang 2020-09-24 13:42:45 UTC
Description of problem:
If you try to cancel a running migration(it's added hooks) , when the migration is canceled, it doesn't stop the Job pod that is used to execute hook script

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

How reproducible:
Always

Steps to Reproduce:
1. Create a migplan which is attached hook script
2. Migrate the migplan
3. Once it start executing hook script, try to cancel the migration process

Actual results:
When the migration is canceled, the Job pod keep running. If the hook script fail, it will continue retrying 6 times(each time takes 30 mins) and then the job pod will be terminated. that doesn't make sense. 

Expected results:
The job should be terminated immediately


Additional info:

Comment 1 Padmanabha V Seshadri 2020-11-20 15:38:35 UTC
Fix available in https://github.com/konveyor/mig-controller/pull/768

To verify the fix:
1. Add a hook to the plan
2. Start migrate
3. Kill the migration when it is running the hook
4. After the migration gets cancelled, the job associated with the hook and corresponding pod should also have been terminated.

Comment 5 Xin jiang 2021-01-11 14:24:34 UTC
verified. When triggering cancel migration, hook pods will be terminated accordingly.


Image:
"registry.redhat.io/rhmtc/openshift-migration-controller-rhel8@sha256:6f53fa6c8ea2648736ced2d38ebb2ead46d3975f71d7efe4bd24e6fec223aaee",

Comment 7 errata-xmlrpc 2021-02-11 12:54:46 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.4.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:5329