Bug 1915279 - Pod health warning contains incorrect field name in the MigPlan CR status
Summary: Pod health warning contains incorrect field name in the MigPlan CR status
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: General
Version: 1.4.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 1.5.0
Assignee: John Matthews
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-12 11:37 UTC by Sergio
Modified: 2023-09-15 00:58 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-28 04:08:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github konveyor mig-controller pull 1067 0 None open Bug 1915279: Fixing status field message for unhealthy pods in migplan 2021-04-09 20:02:20 UTC
Red Hat Product Errata RHEA-2021:2929 0 None None None 2021-07-28 04:08:07 UTC

Description Sergio 2021-01-12 11:37:48 UTC
Description of problem:
When there are pods in a namespace that is going to be migrated, MTC shows a warning in the migplan. This warning tells the user to look for further information in "unhealthyNamespaces", but this field does not exist in the migplan. The right field name is "namespaces"

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

How reproducible:
Always

Steps to Reproduce:
1. Create a namespace in source cluster

oc new-project bz-test

2. Create an unhealthy pod in this namespace

cat << EOF | oc create -f -
apiVersion: v1
kind: Pod
metadata:
  name: pod-test
  namespace: bz-test
spec:
  containers:
  - name: podtest
    image: alpine
    command: [ "/bin/sh", "-c", "--" ]
    args: [ "wrongcommand" ]
EOF


3. Create a migration plan for this namespace

Actual results:
A warning like this one is shown in the migplan resource

    - category: Warn
      lastTransitionTime: "2021-01-12T09:49:16Z"
      message: 'Source namespace(s) contain unhealthy pods. See: `unhealthyNamespaces`
        for details.'
      reason: NotHealthy
      status: "True"
      type: SourcePodsNotHealthy


But there is no field with name "unhealthyNamespaces", the field where we need to look for the information regarding the unhealthy resources is actually "namespaces":

    namespaces:
    - name: bz-test
      workloads:
      - name: Pods
        resources:
        - pod-test


Expected results:
The warning should point to the right field name.


Additional info:

Full migplan status data:

  status:
    conditions:
    - category: Warn
      lastTransitionTime: "2021-01-12T09:49:16Z"
      message: 'Source namespace(s) contain unhealthy pods. See: `unhealthyNamespaces`
        for details.'
      reason: NotHealthy
      status: "True"
      type: SourcePodsNotHealthy
    - category: Required
      lastTransitionTime: "2021-01-12T09:49:18Z"
      message: The `persistentVolumes` list has been updated with discovered PVs.
      reason: Done
      status: "True"
      type: PvsDiscovered
    - category: Required
      lastTransitionTime: "2021-01-12T09:49:19Z"
      message: The storage resources have been created.
      reason: Done
      status: "True"
      type: StorageEnsured
    - category: Required
      lastTransitionTime: "2021-01-12T09:49:19Z"
      message: The migration plan is ready.
      status: "True"
      type: Ready
    destStorageClasses:
    - accessModes:
      - ReadWriteOnce
      default: true
      name: gp2
      provisioner: kubernetes.io/aws-ebs
    excludedResources:
    - imagetags
    - templateinstances
    - clusterserviceversions
    - packagemanifests
    - subscriptions
    - servicebrokers
    - servicebindings
    - serviceclasses
    - serviceinstances
    - serviceplans
    - operatorgroups
    - events
    namespaces:
    - name: bz-test
      workloads:
      - name: Pods
        resources:
        - pod-test
    observedDigest: 58303621a9f3161ab9c1d095a605fcb4ef619d1da5a1633b1bedfec166f8fc06
    srcStorageClasses:
    - accessModes:
      - ReadWriteOnce
      default: true
      name: gp2
      provisioner: kubernetes.io/aws-ebs

Comment 1 Sergio 2021-01-12 11:42:20 UTC
I made a mistake in the description of the problem. The warning is only displayed when the pods are unhealthy.

Description of problem:
When there are UNHEALTHY pods in a namespace that is going to be migrated, MTC shows a warning in the migplan. This warning tells the user to look for further information in "unhealthyNamespaces", but this field does not exist in the migplan. The right field name is "namespaces"

Comment 2 Ian 2021-03-25 16:16:09 UTC
Did we decide that this is not a UI bug? @Sergio mentioned that this deals with the message given on the condition from the controller side.

Comment 3 Erik Nelson 2021-04-07 20:55:24 UTC
@ibolton I'm almost certain this is a backend issue.

Comment 10 Sergio 2021-06-16 11:21:24 UTC
Verified using MTC 1.5.0
SOURCE CLUSTER: AWS OCP 3.11 (CONTROLLER + UI)
TARGET CLUSETR: AWS OCP 4.7

Operator:
    registry.redhat.io/rhmtc/openshift-migration-rhel7-operator@sha256:c0375fa6ecff4d50c181fc3f31d66b6c13023fecb8bcef6899197ccd96c50a30
    - name: MIG_CONTROLLER_REPO
      value: openshift-migration-controller-rhel8@sha256
    - name: MIG_CONTROLLER_TAG
      value: 83f26020b731f78dc9e817186d3247ab46d7daedec62c808be3259ed571656aa
    - name: MIG_UI_REPO
      value: openshift-migration-ui-rhel8@sha256
    - name: MIG_UI_TAG
      value: 4e177e58e311ff2d9c37935308591df5680838255e35b138a696b065c03044f8
    - name: VELERO_REPO
      value: openshift-migration-velero-rhel8@sha256
    - name: VELERO_TAG
      value: e776a798ce8c1b1e6fcc10edaded1e70514a5c6cc2c177dead2d82ef562becde


Now the warning says like this:

  - category: Warn
    lastTransitionTime: "2021-06-16T11:15:15Z"
    message: 'Source namespace(s) contain unhealthy pods. See: `Status.namespaces` for details.'
    reason: NotHealthy
    status: "True"
    type: SourcePodsNotHealthy


And we actually can find the information in 'Status.namespaces' field in the migplan:

$ oc get migplan unhealthy  -ojsonpath='{.status.namespaces}'
[{"name":"bz-test","workloads":[{"name":"Pods","resources":["pod-test"]}]}]



We move the status to VERIFIED.

Comment 16 errata-xmlrpc 2021-07-28 04:08:00 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) image release advisory 1.5.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/RHEA-2021:2929

Comment 17 Red Hat Bugzilla 2023-09-15 00:58:13 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


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