Bug 2236545 - Template validator is broken for spec.domain.memory.guest value
Summary: Template validator is broken for spec.domain.memory.guest value
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: SSP
Version: 4.14.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.14.0
Assignee: Karel Šimon
QA Contact: Kedar Bidarkar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-31 17:07 UTC by vsibirsk
Modified: 2023-11-08 14:07 UTC (History)
2 users (show)

Fixed In Version: kubevirt-ssp-operator-rhel9-container-v4.14.0-106
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-08 14:06:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt ssp-operator pull 679 0 None open fix: fix wrong parsing of vm.spec.template.spec.domain.memory.guest in validator 2023-09-01 08:32:05 UTC
Red Hat Bugzilla 2174892 0 high CLOSED GUI should set VM memory to guest memory instead of memory requests 2023-11-08 14:05:20 UTC
Red Hat Issue Tracker CNV-32658 0 None None None 2023-09-06 08:27:25 UTC
Red Hat Product Errata RHSA-2023:6817 0 None None None 2023-11-08 14:07:21 UTC

Description vsibirsk 2023-08-31 17:07:50 UTC
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
        }
      ]
      ]

Comment 1 vsibirsk 2023-09-11 14:02:00 UTC
Verified with ssp-operator v4.14.0-107

Created RHEL 9 VM from common template.
Validator accepted 1.5G memory.guest value and VM was created successfully.

Comment 3 errata-xmlrpc 2023-11-08 14:06:16 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 (Important: OpenShift Virtualization 4.14.0 Images security and bug fix 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-2023:6817


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