diff --git a/app/calculation/generate_tags.rb b/app/calculation/generate_tags.rb index 5e5a139a..7538028d 100644 --- a/app/calculation/generate_tags.rb +++ b/app/calculation/generate_tags.rb @@ -113,15 +113,6 @@ def network_result def virtual_machine_result [].tap do |results| - if subject.numbered_actor && !subject.numbered_actor.subtree.include?(subject.actor) - results << { - id: ActorAPIName.result_for(subject.actor, numbered_by: subject.numbered_actor), - name: ActorAPIName.result_for(subject.actor, numbered_by: subject.numbered_actor), - config_map: {}, - children: [] - } - end - if subject.customization_specs.size > 1 results << { id: "#{subject.name}_all_specs", diff --git a/app/presenters/api/v3/tags_presenter.rb b/app/presenters/api/v3/tags_presenter.rb index 7abfc0ab..ccc197ef 100644 --- a/app/presenters/api/v3/tags_presenter.rb +++ b/app/presenters/api/v3/tags_presenter.rb @@ -4,7 +4,7 @@ module API module V3 class TagsPresenter < Struct.new(:exercise, :scope) def as_json(_opts) - actor_tags + os_tags + zone_tags + capability_tags + spec_tags + actor_tags + vm_tags + os_tags + zone_tags + capability_tags + spec_tags end private @@ -55,6 +55,12 @@ def spec_tags GenerateTags.result_for(spec_scope.all).uniq end end + + def vm_tags + Rails.cache.fetch(['apiv3', exercise.cache_key_with_version, 'vm_tags', vm_scope.cache_key_with_version]) do + GenerateTags.result_for(vm_scope.all).uniq + end + end end end end