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

[2088849] "dataimportcrontemplate.kubevirt.io/enable" field does not do any validation

XMLWordPrintable

    • CNV I/U Operators Sprint 220
    • No

      Description of problem: Using "dataimportcrontemplate.kubevirt.io/enable", on entering anything other than "true" for a custom template, causes it to be removed from hc.status.dataImportCronTemplates and ssp

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

      How reproducible:
      100%

      Steps to Reproduce:
      1. for a common template add an entry to hco.spec.dataImportCronTemplates with associated annotation value as "dataimportcrontemplate.kubevirt.io/enable": "none"
      2. No error message raised and the dataimportcrontemplate gets removed from hco.status.dataImportCronTemplates and ssp.spec.dataImportCronTemplates
      3.

      Actual results:
      =======================
      (cnv-tests) [cnv-qe-jenkins@c01-db-411-jvnqd-executor cnv-tests]$ kubectl get hco kubevirt-hyperconverged -n openshift-cnv -o json | jq "."
      {
      "apiVersion": "hco.kubevirt.io/v1beta1",
      "kind": "HyperConverged",
      "metadata": {
      "creationTimestamp": "2022-05-19T22:20:18Z",
      "finalizers": [
      "kubevirt.io/hyperconverged"
      ],
      "generation": 35,
      "labels":

      { "app": "kubevirt-hyperconverged" }

      ,
      "name": "kubevirt-hyperconverged",
      "namespace": "openshift-cnv",
      "resourceVersion": "2510485",
      "uid": "d4b2e923-58ff-47e3-ae3b-4235e7a9ef77"
      },
      "spec": {
      "certConfig": {
      "ca":

      { "duration": "48h0m0s", "renewBefore": "24h0m0s" }

      ,
      "server":

      { "duration": "24h0m0s", "renewBefore": "12h0m0s" }

      },
      "dataImportCronTemplates": [
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true", "dataimportcrontemplate.kubevirt.io/enable": "none" }

      ,
      "name": "centos-stream8-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "centos-stream8",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "pullMethod": "node", "url": "docker://quay.io/containerdisks/centos-stream:8" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      }
      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true", "dataimportcrontemplate.kubevirt.io/enable": "false" }

      ,
      "name": "my-image-cron1"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "my",
      "schedule": "21 4/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "imageStream": "my-guest", "pullMethod": "node" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "10Gi" }

      }
      }
      },
      "status": {}
      }
      }
      }
      ],
      "featureGates":

      { "deployTektonTaskResources": false, "enableCommonBootImageImport": true, "nonRoot": true, "sriovLiveMigration": true, "withHostPassthroughCPU": false }

      ,
      "infra": {},
      "liveMigrationConfig":

      { "completionTimeoutPerGiB": 800, "parallelMigrationsPerCluster": 5, "parallelOutboundMigrationsPerNode": 2, "progressTimeout": 150 }

      ,
      "uninstallStrategy": "BlockUninstallIfWorkloadsExist",
      "workloadUpdateStrategy":

      { "batchEvictionInterval": "1m0s", "batchEvictionSize": 10, "workloadUpdateMethods": [ "LiveMigrate" ] }

      ,
      "workloads": {}
      },
      "status": {
      "conditions": [

      { "lastTransitionTime": "2022-05-19T22:20:31Z", "message": "Reconcile completed successfully", "observedGeneration": 35, "reason": "ReconcileCompleted", "status": "True", "type": "ReconcileComplete" }

      ,

      { "lastTransitionTime": "2022-05-20T20:57:19Z", "message": "Reconcile completed successfully", "observedGeneration": 35, "reason": "ReconcileCompleted", "status": "True", "type": "Available" }

      ,

      { "lastTransitionTime": "2022-05-20T20:57:19Z", "message": "Reconcile completed successfully", "observedGeneration": 35, "reason": "ReconcileCompleted", "status": "False", "type": "Progressing" }

      ,

      { "lastTransitionTime": "2022-05-20T20:57:19Z", "message": "Reconcile completed successfully", "observedGeneration": 35, "reason": "ReconcileCompleted", "status": "False", "type": "Degraded" }

      ,

      { "lastTransitionTime": "2022-05-20T20:57:19Z", "message": "Reconcile completed successfully", "observedGeneration": 35, "reason": "ReconcileCompleted", "status": "True", "type": "Upgradeable" }

      ],
      "dataImportCronTemplates": [
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true" }

      ,
      "name": "centos-7-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "centos7",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "url": "docker://quay.io/containerdisks/centos:7-2009" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      },
      "status":

      { "commonTemplate": true }

      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true" }

      ,
      "name": "centos-stream9-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "centos-stream9",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "pullMethod": "node", "url": "docker://quay.io/containerdisks/centos-stream:9" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      },
      "status":

      { "commonTemplate": true }

      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true" }

      ,
      "name": "fedora-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "fedora",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "pullMethod": "node", "url": "docker://quay.io/containerdisks/fedora:35" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      },
      "status":

      { "commonTemplate": true }

      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true", "dataimportcrontemplate.kubevirt.io/enable": "false" }

      ,
      "name": "my-image-cron1"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "my",
      "schedule": "21 4/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "imageStream": "my-guest", "pullMethod": "node" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "10Gi" }

      }
      }
      },
      "status": {}
      }
      },
      "status": {}
      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true" }

      ,
      "name": "rhel8-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "rhel8",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "imageStream": "rhel8-guest", "pullMethod": "node" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      },
      "status":

      { "commonTemplate": true }

      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true" }

      ,
      "name": "rhel9-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "rhel9",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "imageStream": "rhel9-guest", "pullMethod": "node" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      },
      "status":

      { "commonTemplate": true }

      }
      ],
      "dataImportSchedule": "30 2/12 * * *",
      "observedGeneration": 35,
      =======================
      (cnv-tests) [cnv-qe-jenkins@c01-db-411-jvnqd-executor cnv-tests]$ kubectl get ssp ssp-kubevirt-hyperconverged -n openshift-cnv -o json | jq "."
      {
      "apiVersion": "ssp.kubevirt.io/v1beta1",
      "kind": "SSP",
      "metadata": {
      "creationTimestamp": "2022-05-19T22:20:19Z",
      "finalizers": [
      "ssp.kubevirt.io/finalizer"
      ],
      "generation": 31,
      "labels":

      { "app": "kubevirt-hyperconverged", "app.kubernetes.io/component": "schedule", "app.kubernetes.io/managed-by": "hco-operator", "app.kubernetes.io/part-of": "hyperconverged-cluster", "app.kubernetes.io/version": "4.11.0" }

      ,
      "name": "ssp-kubevirt-hyperconverged",
      "namespace": "openshift-cnv",
      "resourceVersion": "2553200",
      "uid": "3cad009f-f54e-422e-be77-9da8c4ac1ced"
      },
      "spec": {
      "commonTemplates": {
      "dataImportCronTemplates": [
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true" }

      ,
      "name": "centos-7-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "centos7",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "url": "docker://quay.io/containerdisks/centos:7-2009" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      }
      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true" }

      ,
      "name": "centos-stream9-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "centos-stream9",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "pullMethod": "node", "url": "docker://quay.io/containerdisks/centos-stream:9" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      }
      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true" }

      ,
      "name": "fedora-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "fedora",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "pullMethod": "node", "url": "docker://quay.io/containerdisks/fedora:35" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      }
      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true", "dataimportcrontemplate.kubevirt.io/enable": "false" }

      ,
      "name": "my-image-cron1"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "my",
      "schedule": "21 4/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "imageStream": "my-guest", "pullMethod": "node" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "10Gi" }

      }
      }
      },
      "status": {}
      }
      }
      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true" }

      ,
      "name": "rhel8-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "rhel8",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "imageStream": "rhel8-guest", "pullMethod": "node" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      }
      },
      {
      "metadata": {
      "annotations":

      { "cdi.kubevirt.io/storage.bind.immediate.requested": "true" }

      ,
      "name": "rhel9-image-cron"
      },
      "spec": {
      "garbageCollect": "Outdated",
      "managedDataSource": "rhel9",
      "schedule": "30 2/12 * * *",
      "template": {
      "metadata": {},
      "spec": {
      "source": {
      "registry":

      { "imageStream": "rhel9-guest", "pullMethod": "node" }

      },
      "storage": {
      "resources": {
      "requests":

      { "storage": "30Gi" }

      }
      }
      },
      "status": {}
      }
      }
      }
      ],
      "namespace": "openshift"
      },
      "nodeLabeller": {},
      "templateValidator":

      { "replicas": 2 }

      },
      "status": {
      "conditions": [

      { "lastHeartbeatTime": "2022-05-20T21:20:25Z", "lastTransitionTime": "2022-05-20T21:20:25Z", "message": "All SSP resources are available", "reason": "Available", "status": "True", "type": "Available" }

      ,

      { "lastHeartbeatTime": "2022-05-20T21:20:25Z", "lastTransitionTime": "2022-05-20T21:20:25Z", "message": "No SSP resources are progressing", "reason": "Progressing", "status": "False", "type": "Progressing" }

      ,

      { "lastHeartbeatTime": "2022-05-20T21:20:25Z", "lastTransitionTime": "2022-05-20T21:20:25Z", "message": "No SSP resources are degraded", "reason": "Degraded", "status": "False", "type": "Degraded" }

      ],
      "observedGeneration": 31,
      "observedVersion": "4.11.0",
      "operatorVersion": "4.11.0",
      "phase": "Deployed",
      "targetVersion": "4.11.0"
      }
      }
      Expected results:
      Validation exists and it prevents from entering invalid values

      Additional info:

              nunnatsa Nahshon Unna Tsameret
              rhn-support-dbasunag Debarati Basu-Nag
              Debarati Basu-Nag Debarati Basu-Nag
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: