Bug 1823830 - Migration plans with double dash in their names break the reconciliation
Summary: Migration plans with double dash in their names break the reconciliation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Migration Tooling
Version: 4.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.4.0
Assignee: Erik Nelson
QA Contact: Xin jiang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-14 15:06 UTC by Sergio
Modified: 2023-09-07 22:48 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-28 11:09:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2020:2326 0 None None None 2020-05-28 11:10:21 UTC

Description Sergio 2020-04-14 15:06:32 UTC
Description of problem:
When we create a plan with a double dash in its name, the reconciliation fails.

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

How reproducible:
Always

Steps to Reproduce:
1. Click on "Add" migration plan
2. Use a fill in the migration plan name with a name with a double dash. For instance "c1-mig-test--pi12"
3. Select the resources you want to migrate
4. In the "Persistent Volumes" screen an error will be displayed complaining about the reconciliation

Actual results:
An error occurs and is displayed in the Persistent Volumes screen

The status of the migration plan is 

$ oc get migplan c1-mig-test--pi12 -o yaml -n openshift-migration
...
status:
  conditions:
  - category: Required
    lastTransitionTime: "2020-04-14T13:41:29Z"
    message: The `persistentVolumes` list has been updated with discovered PVs.
    reason: Done
    status: "True"
    type: PvsDiscovered
  - category: Required
    lastTransitionTime: "2020-04-14T13:41:30Z"
    message: The storage resources have been created.
    status: "True"
    type: StorageEnsured
  - category: Critical
    lastTransitionTime: "2020-04-14T14:42:06Z"
    message: 'Reconcile failed: [ImageStream.image.openshift.io "registry-c1-mig-test--pi12-d7682"
      is invalid: metadata.name: Invalid value: "registry-c1-mig-test--pi12-d7682":
      must match "[a-z0-9]+(?:[._-][a-z0-9]+)*"]. See controller logs for details.'
    status: "True"
    type: ReconcileFailed

Expected results:
The migration should be reconciled properly or, if the name of the plan is not allowed, the name of the plan should be rejected in the migrationplan name field validation.

Additional info:

Comment 17 Dylan Murray 2020-04-28 16:51:16 UTC
Moving to POST as our controller side change allows for migplans to have double dashes in their name.

Comment 27 Sergio 2020-05-08 15:35:16 UTC
Verified using CAM 1.2 stage.

A migration plan with double dash in its name could be migrated without problems.

apiVersion: migration.openshift.io/v1alpha1
kind: MigPlan
metadata:
  annotations:
    openshift.io/touch: 3f1af95c-9141-11ea-a4c0-0a580a810232
  creationTimestamp: "2020-05-08T15:20:06Z"
  generation: 5
  name: c1-mig-test--pi12
  namespace: openshift-migration
  resourceVersion: "772769"
  selfLink: /apis/migration.openshift.io/v1alpha1/namespaces/openshift-migration/migplans/c1-mig-test--pi12
  uid: ff061460-5e61-4dc8-a300-4af55ade929a
spec:
  .......
status:
  conditions:
  - category: Required
    lastTransitionTime: "2020-05-08T15:20:15Z"
    message: The `persistentVolumes` list has been updated with discovered PVs.
    reason: Done
    status: "True"
    type: PvsDiscovered
  - category: Required
    lastTransitionTime: "2020-05-08T15:20:16Z"
    message: The storage resources have been created.
    status: "True"
    type: StorageEnsured
  - category: Required
    lastTransitionTime: "2020-05-08T15:20:18Z"
    message: The migration registry resources have been created.
    status: "True"
    type: RegistriesEnsured
  - category: Required
    lastTransitionTime: "2020-05-08T15:20:18Z"
    message: The migration plan is ready.
    status: "True"
    type: Ready
  - category: Advisory
    lastTransitionTime: "2020-05-08T15:21:11Z"
    message: Limited validation; PV discovery and resource reconciliation suspended.
    status: "True"
    type: Suspended

Comment 28 Dylan Murray 2020-05-11 14:29:54 UTC
Clearing needinfo as this discussion has been moved off bugzilla.

Comment 30 errata-xmlrpc 2020-05-28 11:09:56 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, 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-2020:2326


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