Bug 1997180 - "migration-log-reader" pod does not log invalid Rsync options
Summary: "migration-log-reader" pod does not log invalid Rsync options
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: Controller
Version: 1.6.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 1.6.0
Assignee: Pranav Gaikwad
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-24 14:50 UTC by Prasad Joshi
Modified: 2021-09-29 14:35 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-09-29 14:35:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github konveyor mig-controller pull 1180 0 None None None 2021-08-25 19:29:31 UTC
Red Hat Product Errata RHSA-2021:3694 0 None None None 2021-09-29 14:35:31 UTC

Description Prasad Joshi 2021-08-24 14:50:25 UTC
Description of problem: When we add a invalid option in migrationcontroller CR it should reject it and the logs should tell that the option was rejected.

Version-Release number of selected component (if applicable):
SOURCE CLUSTER: Azure OCP 4.6 (MTC 1.6.0)
TARGET CLUSTER: Azure OCP 4.9 (MTC 1.6.0)
REPLICATION REPOSITORY: Azure Blob Storage

How reproducible:
Always

Steps to Reproduce:
1. In source cluster create a PVC using the default storageclass, and request 1Gi and mount it in a pod.

$ oc new-project ocp-40342-invalidrsyncopts

$ cat <<EOF | oc create -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  namespace: ocp-40342-invalidrsyncopts
  name: test-data
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
EOF

$ cat <<EOF | oc create -f -
apiVersion:  apps/v1
kind: Deployment
metadata:
  labels:
    app: pod-test
  name: pod-test
  namespace: ocp-40342-invalidrsyncopts
spec:
  replicas:  1
  selector:
    matchLabels:
      app: resize-test
  template:
    metadata:
      labels:
        app: resize-test
    spec:
      containers:
      - name: podtest
        imagePullPolicy: Always
        image: alpine
        command: [ "/bin/sh", "-c", "--" ]
        args: [ "while true; do sleep 30; done;" ]
        restartPolicy: Never
        volumeMounts:
        - name: testvolume
          mountPath: /data/test
      volumes:
      - name: testvolume
        persistentVolumeClaim:
          claimName: test-data
EOF

2. Configure extra rsync options in the MigrationController resource. 

We add a wrong extra option containing the ";" (semicolon) character: "rsync_opt_extras": "--myextraoption;semicolon"

oc -n openshift-migration patch migrationcontroller migration-controller  -p '{"spec":{"rsync_opt_extras": "--myextraoption;semicolon", "rsync_opt_bwlimit": "220"}  }' --type='merge';


3. Create a migration plan for ocp-40342-invalidrsyncopts namespace with Direct Volume Migration and execute migration.


Actual results:
migration-log-reader pod is not reporting logs regarding invalid options

Expected results:
migration-log-reader pod should report logs for invalid rsync options

Comment 5 Xin jiang 2021-09-01 06:41:30 UTC
verified with MTC 1.6.0

$  oc -n openshift-migration logs $(oc get pods -l logreader=mig -oname) -c plain |grep semicolon | grep -i invalid
openshift-migration migration-controller-6df9dcd9cd-5vtwq mtc {"level":"info","ts":1630476842.0661273,"logger":"directvolume","msg":"Invalid Rsync extra option passed","dvm":"migration-ac55a-kdgx5","migMigration":"migration-ac55a","option":"--myextraoption;semicolon"}
openshift-migration migration-controller-6df9dcd9cd-5vtwq mtc {"level":"info","ts":1630476869.4038439,"logger":"directvolume","msg":"Invalid Rsync extra option passed","dvm":"migration-ac55a-kdgx5","migMigration":"migration-ac55a","option":"--myextraoption;semicolon"}



registry.redhat.io/rhmtc/openshift-migration-controller-rhel8@sha256:d1bb94853b42abef96ec2c63600ebac41b0163d88fc25571f7b40c6c1d2f8c40

Comment 7 errata-xmlrpc 2021-09-29 14:35:20 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 (Moderate: Migration Toolkit for Containers (MTC) 1.6.0 security & bugfix update), 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/RHSA-2021:3694


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