Skip to content

Commit

Permalink
Merge pull request #255 from nasark/fix_memory_dig_during_refresh_parse
Browse files Browse the repository at this point in the history
Fix memory attribute retrieval in parser
  • Loading branch information
agrare committed Oct 29, 2024
2 parents e1e2eeb + 060f51e commit 8f290e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/manageiq/providers/kubevirt/inventory/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions spec/fixtures/files/template-without-parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ objects:
domain:
cpu:
cores: 2
resources:
requests:
memory: 1Gi
memory:
guest: 1Gi
devices:
disks:
- disk:
Expand Down

0 comments on commit 8f290e2

Please sign in to comment.