Bug 1936894 - "Ready" status of MigHook and MigPlan custom resources is not synchronized automatically
Summary: "Ready" status of MigHook and MigPlan custom resources is not synchronized au...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: General
Version: 1.4.2
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 1.6.0
Assignee: Jason Montleon
QA Contact: Xin jiang
Avital Pinnick
URL: https://github.com/konveyor/mig-contr...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-09 12:32 UTC by whu
Modified: 2021-09-29 14:34 UTC (History)
6 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github konveyor mig-controller pull 1176 0 None None None 2021-08-23 18:16:17 UTC
Red Hat Product Errata RHSA-2021:3694 0 None None None 2021-09-29 14:34:55 UTC

Description whu 2021-03-09 12:32:26 UTC
Description of problem:
If the status of a `mighooks` has been changed to `Not Ready`, the related migplan status will keep `Ready` until try to edit the migplan again.
If a migplan is `Not ready` due to related mighooks is not ready, after fixing the problem of hook, the mighook become ready, but the migplan is still `Not ready`.
BTW, if there is an error message in mighook yaml, BUT there is NO error report in MTC hook web page.

Version-Release number of selected component (if applicable):
MTC 1.4.2
image: registry.redhat.io/rhmtc/openshift-migration-rhel7-operator@sha256:9e8990d8c4b54b2d72122ac4cbe5d76ad073c44f1295b4f4128ed767de511230
source cluster: AWS OCP 4.4
target cluster: AWS OCP 4.7  (controller)

How reproducible:
Always

Steps to Reproduce:
1. Add a healthy mighook in MTC hook page, such like "sourceprebackuphook"
$ oc get mighooks sourceprebackuphook-nq48l -o yaml
apiVersion: migration.openshift.io/v1alpha1
kind: MigHook
metadata:
  name: sourceprebackuphook-nq48l
  namespace: openshift-migration
.....
spec:
  custom: false
  image: quay.io/sregidor/customhook:latest
  playbook: LSBob3N0czogbG9jYWxob3N0CiAgdGFza3M6CiAgLSBuYW1lOiBHZXQgUG9kcwogICAgazhzX2ZhY3RzOgogICAgICBraW5kOiBQb2QKICAgICAgbmFtZXNwYWNlOiAib3BlbnNoaWZ0LW1pZ3JhdGlvbiIKICAgICAgbGFiZWxfc2VsZWN0b3JzOiAiYXBwPW1pZ3JhdGlvbiIKICAgIHJlZ2lzdGVyOiBwb2QKICAgIHJldHJpZXM6IDUKICAgIHVudGlsOiBwb2QucmVzb3VyY2VzIHwgbGVuZ3RoID4gMA==
  targetCluster: source
status:
  conditions:
  - category: Required
    lastTransitionTime: "2021-03-09T09:51:26Z"
    message: The hook is ready.
    status: "True"
    type: Ready
  observedGeneration: 18


2. Created a migplan for a project and invoked sourceprebackuphook mighook in MTC web page, everything is well
$ oc new-project hook-test-project      //in source cluster

$ oc get migplan plan-hook-test  -o yaml
apiVersion: migration.openshift.io/v1alpha1
kind: MigPlan
metadata:
.....
  name: plan-hook-test
  namespace: openshift-migration
........
spec:
  destMigClusterRef:
    name: host
    namespace: openshift-migration
  hooks:
  - executionNamespace: robot-target
    phase: PreBackup
    reference:
      name: sourceprebackuphook-nq48l
      namespace: openshift-migration
    serviceAccount: robot-target
  indirectVolumeMigration: true
  migStorageRef:
    name: automatic
    namespace: openshift-migration
  namespaces:
  - hook-test-project
  srcMigClusterRef:
    name: source-cluster
    namespace: openshift-migration

3. edit the mighook "sourceprebackuphook" in MTC hook web page, add a space in `Ansible runtime image` section. then, the mighooks "sourceprebackuphook" will become to not ready. There is a error message in mighook yaml,BUT THERE IS NO any error report in MTC hook web page.

$ oc get mighooks
NAME                        READY   IMAGE                                 TARGETCLUSTER   AGE
sourceprebackuphook-nq48l            quay.io/sregidor/customhook:latest   source          70m


$ oc get mighooks -o yaml
apiVersion: v1
items:
- apiVersion: migration.openshift.io/v1alpha1
  kind: MigHook
  metadata:
.....
  spec:
    custom: false
    image: ' quay.io/sregidor/customhook:latest'
    playbook: LSBob3N0czogbG9jYWxob3N0CiAgdGFza3M6CiAgLSBuYW1lOiBHZXQgUG9kcwogICAgazhzX2ZhY3RzOgogICAgICBraW5kOiBQb2QKICAgICAgbmFtZXNwYWNlOiAib3BlbnNoaWZ0LW1pZ3JhdGlvbiIKICAgICAgbGFiZWxfc2VsZWN0b3JzOiAiYXBwPW1pZ3JhdGlvbiIKICAgIHJlZ2lzdGVyOiBwb2QKICAgIHJldHJpZXM6IDUKICAgIHVudGlsOiBwb2QucmVzb3VyY2VzIHwgbGVuZ3RoID4gMA==
    targetCluster: source
  status:
    conditions:
    - category: Critical
      lastTransitionTime: "2021-03-09T10:03:39Z"
      message: The image name specified in spec.Image is invalid.
      reason: NotSet
      status: "True"
      type: InvalidImage
    observedGeneration: 20

4. the related migplan `plan-hook-test` still is ready
$ oc get migplan plan-hook-test
NAME             READY   SOURCE           TARGET   STORAGE     AGE
plan-hook-test   True    source-cluster   host     automatic   11m

5,  edit  migplan `plan-hook-test` in MTC web page again, during the edit process, will get an error message "One or more referenced hooks are not ready".

6. cancel the migplan edit process, the migplan becomes "Not Ready".

7. fix problem of mighook "sourceprebackuphook", make it become to ready.
$ oc get mighook sourceprebackuphook-nq48l  -o yaml
apiVersion: migration.openshift.io/v1alpha1
kind: MigHook
metadata:
.....
  name: sourceprebackuphook-nq48l
  namespace: openshift-migration
.....
spec:
  custom: false
  image: quay.io/sregidor/customhook:latest
  playbook: LSBob3N0czogbG9jYWxob3N0CiAgdGFza3M6CiAgLSBuYW1lOiBHZXQgUG9kcwogICAgazhzX2ZhY3RzOgogICAgICBraW5kOiBQb2QKICAgICAgbmFtZXNwYWNlOiAib3BlbnNoaWZ0LW1pZ3JhdGlvbiIKICAgICAgbGFiZWxfc2VsZWN0b3JzOiAiYXBwPW1pZ3JhdGlvbiIKICAgIHJlZ2lzdGVyOiBwb2QKICAgIHJldHJpZXM6IDUKICAgIHVudGlsOiBwb2QucmVzb3VyY2VzIHwgbGVuZ3RoID4gMA==
  targetCluster: source
status:
  conditions:
  - category: Required
    lastTransitionTime: "2021-03-09T10:13:18Z"
    message: The hook is ready.
    status: "True"
    type: Ready
  observedGeneration: 22

8, the migplan `plan-hook-test` still is NOT $ oc get migplan plan-hook-test
NAME             READY   SOURCE           TARGET   STORAGE     AGE
plan-hook-test           source-cluster   host     automatic   16m
ready

Actual results:
The "ready" status of mighooks and related migplan is not synchronized automatically


Expected results:
The "ready" status of mighooks and related migplan should be synchronized automatically

Additional inforamtion

Comment 4 Xin jiang 2021-09-01 08:33:08 UTC
verified with mtc 1.6.0

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

Comment 6 errata-xmlrpc 2021-09-29 14:34:47 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.