diff --git a/meta/io.murano/Classes/resources/Instance.yaml b/meta/io.murano/Classes/resources/Instance.yaml index 24b75407..236eea85 100644 --- a/meta/io.murano/Classes/resources/Instance.yaml +++ b/meta/io.murano/Classes/resources/Instance.yaml @@ -240,28 +240,15 @@ Methods: - $.setAttr(fipAssigned, true) destroy: - # Fixme(smelikyan): We need to remove all associated resources on destroy + # FIXME(smelikyan): All allocated resources should be cleaned-up on destroy + # Now no clean-up happens here cause we don't track all native resources + # that are allocated at the moment in descendants of Instance or other + # classes that may allocate resource dependent on OS::Nova:Server used + # as underlying implementation for Instance. This can cause + # resource leak when environment is updated. Resources are cleaned-up only + # when whole Environment is deleted (alongside with Heat stack deletion). + # https://bugs.launchpad.net/murano/+bug/1359998 Body: - - $template: $.environment.stack.current() - # Remove OS::Nova::Server resource - - $patchBlock: - op: remove - path: format('/resources/{0}', $.name) - - $template: patch($template, $patchBlock) - # Remove Ip Addresses Outputs assigned to this Instance - - $assignedIpBlock: - op: remove - path: format('/outputs/{0}-assigned-ip', $.name) - - $template: patch($template, $assignedIpBlock) - # Remove Floatting IP Addresses Outputs - - If: $.getAttr(fipAssigned, false) - Then: - - $assignedFloatingIpBlock: - op: remove - path: format('/outputs/{0}-FloatingIPaddress', $.name) - - $template: patch($template, $assignedFloatingIpBlock) - - $.environment.stack.setTemplate($template) - - $.environment.stack.push() - $.environment.instanceNotifier.untrackCloudInstance($this) createDefaultInstanceSecurityGroupRules: diff --git a/murano/tests/functional/engine/base.py b/murano/tests/functional/engine/base.py index ec6e0243..a1b3b047 100644 --- a/murano/tests/functional/engine/base.py +++ b/murano/tests/functional/engine/base.py @@ -402,6 +402,9 @@ class MuranoBase(testtools.TestCase, testtools.testcase.WithAttributes, return stack def test_instance_refs_are_removed_after_application_is_removed(self): + # FIXME(sergmelikyan): Revise this as part of proper fix for #1359998 + self.skipTest('Skipped until proper fix for #1359998 is proposed') + name = 'e' + uuid.uuid4().hex # create environment with telnet application diff --git a/murano/tests/unit/core_library/__init__.py b/murano/tests/unit/core_library/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/murano/tests/unit/core_library/instance/__init__.py b/murano/tests/unit/core_library/instance/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/murano/tests/unit/core_library/instance/test_destroy/__init__.py b/murano/tests/unit/core_library/instance/test_destroy/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/murano/tests/unit/core_library/instance/test_destroy/test_destroy.py b/murano/tests/unit/core_library/instance/test_destroy/test_destroy.py index 7af04268..08945d77 100644 --- a/murano/tests/unit/core_library/instance/test_destroy/test_destroy.py +++ b/murano/tests/unit/core_library/instance/test_destroy/test_destroy.py @@ -40,6 +40,9 @@ TEMPLATE = { class TestDestroy(test_case.DslTestCase): def test_destroy_removes_ip_address_from_outputs(self): + # FIXME(sergmelikyan): Revise this as part of proper fix for #1359998 + self.skipTest('skipped until proper fix for #1359998 is proposed') + heat_stack_obj = om.Object('io.murano.system.HeatStack') instance_obj = om.Object( 'io.murano.resources.Instance',