Bug 2005848 - [MTC] Migplan should not be ready if target namespace is not DNS compliant [NEEDINFO]
Summary: [MTC] Migplan should not be ready if target namespace is not DNS compliant
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: Controller
Version: 1.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 1.7.0
Assignee: Jaydip Gabani
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-20 10:32 UTC by Prasad Joshi
Modified: 2022-03-24 06:32 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-24 06:32:26 UTC
Target Upstream Version:
Embargoed:
jgabani: needinfo?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github konveyor mig-controller pull 1250 0 None Merged Bug 2005848 - Adding validation for DNS compliant namespace names on destination cluster in migplan 2022-01-21 18:50:12 UTC
Red Hat Product Errata RHBA-2022:1043 0 None None None 2022-03-24 06:32:38 UTC

Description Prasad Joshi 2021-09-20 10:32:55 UTC
Description of problem: When we create migplan from the backend it should verify the target namespace name and report warnings if it’s not a DNS compliant name.


Version-Release number of selected component (if applicable): 
SOURCE CLUSTER: AWS 4.6 (MTC 1.6.0)
TARGET CLUSTER: AWS 4.9 (MTC 1.6.0) (CONTROLLER + UI)

How reproducible:
Always

Steps to Reproduce:
1. Create a migplan from UI 

2. Edit migplan from backend
$ oc edit migplan test -n openshift-migration

3.Map namespace to any destination namespace which is not DNS compliant 
$ oc get migplan -n openshift-migration test -o yaml
  spec:
    destMigClusterRef:
      name: host
      namespace: openshift-migration
    indirectImageMigration: true
    indirectVolumeMigration: true
    migStorageRef:
      name: automatic
      namespace: openshift-migration
    namespaces:
    - test:test-


Actual results: Migplan is in ready state


Expected results: Migplan should be in not ready state


Additional info: 
Migplan is in ready state

Expected results: Migplan should be in not ready state

Additional Info: 

oc get migplan -n openshift-migration test -o yaml
status:
  conditions:
  - category: Required
    lastTransitionTime: "2021-09-20T09:38:27Z"
    message: The `persistentVolumes` list has been updated with discovered PVs.
    reason: Done
    status: "True"
    type: PvsDiscovered
  - category: Required
    lastTransitionTime: "2021-09-20T09:38:27Z"
    message: The storage resources have been created.
    reason: Done
    status: "True"
    type: StorageEnsured
  - category: Required
    lastTransitionTime: "2021-09-20T09:38:27Z"
    message: The migration plan is ready.
    status: "True"
    type: Ready

Comment 1 Jaydip Gabani 2022-01-10 18:10:55 UTC
The code is written in a way that it filters out the namespace from not DNS compliant names, in this case, mig-plan controller filters the namespace name "test" from the passed name "test:test-", and since the namespaces named "test" exists in the source cluster the plan will eventually end up in Ready state if everything else is alright!

This is the expected behavior since such behavior is explicitly coded in, this shouldn't be considered as a bug.

@

Comment 2 Jaydip Gabani 2022-01-10 18:13:31 UTC
 @

Comment 3 Jaydip Gabani 2022-01-10 19:06:09 UTC
Sorry, I misread the code and comments on bug, fixed the bug and with this PR - https://github.com/konveyor/mig-controller/pull/1250 and now the result is 


namespaces:
    - 'crane-ui-plugin:test-'
  srcMigClusterRef:
    name: source
    namespace: openshift-migration
status:
  conditions:
    - category: Warn
      lastTransitionTime: '2022-01-10T18:46:37Z'
      message: >-
        Cluster operator versions do not match. Source, destination, and host
        clusters must all have the same MTC operator version.
      reason: Conflict
      status: 'True'
      type: ClusterVersionMismatch
    - category: Required
      lastTransitionTime: '2022-01-10T18:46:40Z'
      message: The `persistentVolumes` list has been updated with discovered PVs.
      reason: Done
      status: 'True'
      type: PvsDiscovered
    - category: Critical
      lastTransitionTime: '2022-01-10T18:58:44Z'
      message: 'Destination Namespaces [test-] are not DNS compliant.'
      reason: NotDNSCompliant
      status: 'True'
      type: NotDNSCompliantNamespece

Comment 10 errata-xmlrpc 2022-03-24 06:32:26 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) 1.7.0 release advisory), 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-2022:1043


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