Bug 2104864 - [MTC] Registry validation is failing when two trailing slash(“//”) are added to the Exposed route host to image registry.
Summary: [MTC] Registry validation is failing when two trailing slash(“//”) are added ...
Keywords:
Status: ASSIGNED
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: Controller
Version: 1.7.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 1.7.z
Assignee: Ian
QA Contact: ssingla
Richard Hoch
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-07 10:58 UTC by Prasad Joshi
Modified: 2022-08-25 13:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Prasad Joshi 2022-07-07 10:58:59 UTC
Description of problem: After adding two trailing slash to the exposed registry route, the migcluster resource is showing the status as connected, when we create a migplan from backend with DIM, the plans goes to the unready status.


Version-Release number of selected component (if applicable):
Source GCP 4.6   MTC 1.7.2 + OADP 1.0.3
Target  GCP  4.11   MTC 1.7.2 + OADP 1.0.3


How reproducible: 
Always


Steps to Reproduce:
1. Add two trailing slash (“//”) at the Exposed route host to image registry 
2. Create a migplan, select DIM.


Actual results: Migplan goes to the unready status due to the invalid exposedRegistryRoute. 

$ oc get migplan -n openshift-migration ocp-attached-pvc -o yaml
apiVersion: migration.openshift.io/v1alpha1
kind: MigPlan
metadata:
  annotations:
    migration.openshift.io/selected-migplan-type: full
  name: ocp-attached-pvc
  namespace: openshift-migration
spec:
  destMigClusterRef:
    name: host
    namespace: openshift-migration
  migStorageRef:
    name: automatic
    namespace: openshift-migration
  namespaces:
  - ocp-attached-pvc
  persistentVolumes:
  - capacity: 1Gi
    name: pvc-c1509d5a-a5b8-44fb-8501-1098672cb977
    proposedCapacity: 1Gi
    pvc:
      accessModes:
      - ReadWriteOnce
      hasReference: true
      name: test-data
      namespace: ocp-attached-pvc
    selection:
      action: copy
      copyMethod: filesystem
      storageClass: standard
    storageClass: standard
    supported:
      actions:
      - skip
      - copy
      copyMethods:
      - filesystem
      - snapshot
  srcMigClusterRef:
    name: source-cluster
    namespace: openshift-migration
status:
  conditions:
  - category: Required
    lastTransitionTime: "2022-07-07T08:08:26Z"
    message: The `persistentVolumes` list has been updated with discovered PVs.
    reason: Done
    status: "True"
    type: PvsDiscovered
  - category: Required
    lastTransitionTime: "2022-07-07T08:08:26Z"
    message: The storage resources have been created.
    reason: Done
    status: "True"
    type: StorageEnsured
  - category: Critical
    lastTransitionTime: "2022-07-07T09:26:41Z"
    message: Direct image migration is selected and the source cluster openshift-migration/source-cluster is missing a configured Registry Path
    reason: NotSet
    status: "True"
    type: SourceClusterNoRegistryPath
  destStorageClasses:
  - accessModes:
    - ReadWriteOnce
    name: ssd-csi
    provisioner: pd.csi.storage.gke.io
  - accessModes:
    - ReadWriteOnce
    - ReadOnlyMany
    default: true
    name: standard
    provisioner: kubernetes.io/gce-pd
  - accessModes:
    - ReadWriteOnce
    name: standard-csi
    provisioner: pd.csi.storage.gke.io
  excludedResources:
  - imagetags
  - templateinstances
  - clusterserviceversions
  - packagemanifests
  - subscriptions
  - servicebrokers
  - servicebindings
  - serviceclasses
  - serviceinstances
  - serviceplans
  - operatorgroups
  - events
  - events.events.k8s.io
  - rolebindings.authorization.openshift.io
  observedDigest: e54977116824cf3aa016d5fd5bab25206b87ca58d1fb038e2580740c72dc9628
  srcStorageClasses:
  - accessModes:
    - ReadWriteOnce
    - ReadOnlyMany
    default: true
    name: standard
    provisioner: kubernetes.io/gce-pd

$ oc get migcluster -n openshift-migration source-cluster -o yaml
apiVersion: migration.openshift.io/v1alpha1
kind: MigCluster
metadata:
  name: source-cluster
  namespace: openshift-migration
spec:
  exposedRegistryPath: default-route-openshift-image-registry.apps.cam-src-43330.qe.gcp.devcluster.openshift.com//
  insecure: true
  isHostCluster: false
  serviceAccountSecretRef:
    name: sa-token-source-cluster
    namespace: openshift-migration
  url: https://api.cam-src-43330.qe.gcp.devcluster.openshift.com:6443
status:
  conditions:
  - category: Required
    lastTransitionTime: "2022-07-07T05:46:03Z"
    message: The cluster is ready.
    status: "True"
    type: Ready
  observedDigest: 1d554f14291c1b06c8e1c530ebc1347556c2bbb2e8d0f33590d1b4bff54359f1
  operatorVersion: 1.7.2


Expected results: Migcluster resource should not get ready when invalid registry route entered.


Additional info:


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