Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-22601

[2143716] [4.13]VMExport: fix DV Error message when trying to import without certConfigMap and secretExtraHeaders

XMLWordPrintable

    • Storage Core Sprint 231, Storage Core Sprint 232
    • Medium
    • None

      Description of problem:
      DV Error message when trying to import without secret-headers shouldn't contain the stack trace

      Version-Release number of selected component (if applicable):
      4.12.0-682

      How reproducible:
      Always

      Steps to Reproduce:

      1. Create a VM, Stop it

      2. Create a VMExport without specifying the tokenSecretRef:

      $ cat vmexport-vm.yaml
      apiVersion: export.kubevirt.io/v1alpha1
      kind: VirtualMachineExport
      metadata:
      name: export-vm-object
      spec:
      source:
      apiGroup: "kubevirt.io"
      kind: VirtualMachine
      name: vm-cirros-source

      3. See VMExport certs and links are populated:

      $ oc get vmexport export-vm-object -oyaml

      3. Create a target VM using an internal link, without specifying the certConfigMap and secretExtraHeaders:

      $ cat vm-target-internal-raw.yaml
      apiVersion: kubevirt.io/v1alpha3
      kind: VirtualMachine
      metadata:
      name: vm-cirros-target-1
      labels:
      kubevirt.io/vm: vm-cirros-target-1
      spec:
      dataVolumeTemplates:

      • metadata:
        name: cirros-dv-target-1
        spec:
        storage:
        resources:
        requests:
        storage: 1Gi
        storageClassName: hostpath-csi-basic
        source:
        http:
        url: "https://virt-export-export-vm-object.default.svc/volumes/cirros-dv-source-ocs/disk.img"
      1. certConfigMap: "router-cert"
      2. secretExtraHeaders:
      3. - secret-headers
        running: true
        template:
        metadata:
        labels:
        kubevirt.io/vm: vm-cirros-target-1
        spec:
        domain:
        devices:
        disks:
      • disk:
        bus: virtio
        name: datavolumetarget
        machine:
        type: ""
        resources:
        requests:
        memory: 100M
        terminationGracePeriodSeconds: 0
        volumes:
      • dataVolume:
        name: cirros-dv-target-1
        name: datavolumetarget

      Actual results:

      $ oc get vm -A
      NAMESPACE NAME AGE STATUS READY
      default vm-cirros-source 41m Stopped False
      default vm-cirros-target-1 24m DataVolumeError False

      $ oc describe dv cirros-dv-target-1 | grep Message
      Message: PVC cirros-dv-target-1 Bound
      Message: Unable to connect to http data source: Get "https://virt-export-export-vm-object.default.svc/volumes/cirros-dv-source-ocs/disk.img": x509: certificate signed by unknown authority HTTP request errored kubevirt.io/containerized-data-importer/pkg/importer.createHTTPReader /remote-source/app/pkg/importer/http-datasource.go:326 kubevirt.io/containerized-data-importer/pkg/importer.NewHTTPDataSource /remote-source/app/pkg/importer/http-datasource.go:100 main.newDataSource /remote-source/app/cmd/cdi-importer/importer.go:255 main.handleImport /remote-source/app/cmd/cdi-importer/importer.go:173 main.main /remote-source/app/cmd/cdi-importer/importer.go:143 runtime.main /usr/lib/golang/src/runtime/proc.go:250 runtime.goexit /usr/lib/golang/src/runtime/asm_amd64.s:1594

      Expected results:
      The Error message shouldn't contain the stack trace

              rh-ee-alromero Alvaro Romero
              jpeimer@redhat.com Jenia Peimer
              Jenia Peimer Jenia Peimer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: