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

[2236545] Template validator is broken for spec.domain.memory.guest value

XMLWordPrintable

    • High
    • No

      Description of problem:
      Template validator fails on spec.domain.memory.guest values

      Version-Release number of selected component (if applicable):
      common templates version v0.26

      How reproducible:
      100%

      Steps to Reproduce:
      1.Try to create a VM from any common template of ver 0.26
      2.
      3.

      Actual results:
      fails to create a VM
      validator show error
      Error "This VM requires more memory.: mismatching type: , not int or resource.Quantity" for field ".spec.domain.memory.guest".

      Expected results:
      VM created successfully

      Additional info:
      Seems like like current template validator can't parse G,Gi,M,Mi,etc strings into integers (like with spec.domain.resources.requests.memory)

      Gives error when setting memory.guest to 1.5Gi
      vm.kubevirt.io/validations: |
      [

      { "name": "minimal-required-memory", "path": "jsonpath::.spec.domain.memory.guest", "rule": "integer", "message": "This VM requires more memory.", "min": 1610612736 }

      Validates resources.requests.memory value of 1.5Gi
      vm.kubevirt.io/validations: |
      [

      { "name": "minimal-required-memory", "path": "jsonpath::.spec.domain.resources.requests.memory", "rule": "integer", "message": "This VM requires more memory.", "min": 1610612736 }

      ]
      ]

              ksimon@redhat.com Karel Simon
              vsibirsk Vasiliy Sibirskiy
              Geetika Kapoor Geetika Kapoor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: