Bug 1967858 - Custom resources are not migrated
Summary: Custom resources are not migrated
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: General
Version: 1.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 1.5.0
Assignee: Scott Seago
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-04 09:14 UTC by Sergio
Modified: 2021-07-28 04:08 UTC (History)
4 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:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2021:2929 0 None None None 2021-07-28 04:08:22 UTC

Description Sergio 2021-06-04 09:14:19 UTC
Description of problem:
When we try to migrate Custom Resources the CRD is migrated, but the CR is not.


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

How reproducible:
Always
TARGET CLUSTER: AWS 4.7 
SOURCE CLUSTER: AWS 3.11
REPLICATION REPOSITORY: MCG

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

$ oc new-project bz-test-crd


2. Make sure that the new CRD does not exist in the target cluster 

$ oc delete crd deploycustoms.samplecontroller.k8s.io


2. Create a custom resource definition in source cluster

$ cat <<EOF | oc create -f -
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: deploycustoms.samplecontroller.k8s.io
spec:
  group: samplecontroller.k8s.io
  version: v1alpha1
  names:
    kind: DeployCustom
    plural: deploycustoms
  scope: Namespaced
EOF


3. Create a CR in using that CRD in your new namespace

$ cat <<EOF | oc create -f -
apiVersion: samplecontroller.k8s.io/v1alpha1
kind: DeployCustom
metadata:
  name: 'example-deployment'
  namespace: 'bz-test-crd'
spec:
  deploymentName: 'example-deployment'
  replicas: 1
  image: quay.io/thisisatest/openshift-nginx:latest
EOF

4. Migrate the namespace


Actual results:
The CRD will be migrated to the target cluster, but the CR will not be migrated.

Expected results:
Both, the CRD and the CR should be migrated to the target cluster.

Additional info:

Comment 1 Scott Seago 2021-06-04 19:13:02 UTC
PR fix is here: https://github.com/konveyor/velero/pull/98

Comment 5 Sergio 2021-06-16 10:14:22 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

The case ocp-34703-crd passed without problems.

We move the BZ to VERIFIED status.

Comment 11 errata-xmlrpc 2021-07-28 04:08:13 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


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