From 46e3540ae5691c266ea68a2cdc0f55a72fd766c5 Mon Sep 17 00:00:00 2001 From: Nasar Khan Date: Tue, 29 Oct 2024 14:50:11 -0400 Subject: [PATCH 1/2] fix memory attribute dig in parser --- app/models/manageiq/providers/kubevirt/inventory/parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/manageiq/providers/kubevirt/inventory/parser.rb b/app/models/manageiq/providers/kubevirt/inventory/parser.rb index 74c0015..0cf780f 100644 --- a/app/models/manageiq/providers/kubevirt/inventory/parser.rb +++ b/app/models/manageiq/providers/kubevirt/inventory/parser.rb @@ -222,7 +222,7 @@ def process_hardware(template_object, params, labels, domain) require 'fog/kubevirt' require 'fog/kubevirt/compute/models/template' hw_object = hw_collection.find_or_build(template_object) - memory = default_value(params, 'MEMORY') || domain.dig(:resources, :requests, :memory) + memory = default_value(params, 'MEMORY') || domain.dig(:memory, :guest) hw_object.memory_mb = parse_quantity(memory) / 1.megabytes.to_f if memory cpu = default_value(params, 'CPU_CORES') || domain.dig(:cpu, :cores) hw_object.cpu_cores_per_socket = cpu From 060f51e1190380016f9a38320bb25aad73c48ee7 Mon Sep 17 00:00:00 2001 From: Nasar Khan Date: Tue, 29 Oct 2024 15:18:52 -0400 Subject: [PATCH 2/2] update memory in template spec --- spec/fixtures/files/template-without-parameters.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/fixtures/files/template-without-parameters.yml b/spec/fixtures/files/template-without-parameters.yml index 1d2c7e1..76875e4 100644 --- a/spec/fixtures/files/template-without-parameters.yml +++ b/spec/fixtures/files/template-without-parameters.yml @@ -26,9 +26,8 @@ objects: domain: cpu: cores: 2 - resources: - requests: - memory: 1Gi + memory: + guest: 1Gi devices: disks: - disk: