diff --git a/heat/engine/resources/openstack/octavia/pool_member.py b/heat/engine/resources/openstack/octavia/pool_member.py index aa154f8d7c..dcf0ee23fd 100644 --- a/heat/engine/resources/openstack/octavia/pool_member.py +++ b/heat/engine/resources/openstack/octavia/pool_member.py @@ -15,6 +15,7 @@ from heat.common.i18n import _ from heat.engine import constraints from heat.engine import properties from heat.engine.resources.openstack.octavia import octavia_base +from heat.engine import support from heat.engine import translation @@ -26,10 +27,10 @@ class PoolMember(octavia_base.OctaviaBase): PROPERTIES = ( POOL, ADDRESS, PROTOCOL_PORT, MONITOR_ADDRESS, MONITOR_PORT, - WEIGHT, ADMIN_STATE_UP, SUBNET, + WEIGHT, ADMIN_STATE_UP, SUBNET, TAGS ) = ( 'pool', 'address', 'protocol_port', 'monitor_address', 'monitor_port', - 'weight', 'admin_state_up', 'subnet' + 'weight', 'admin_state_up', 'subnet', 'tags' ) ATTRIBUTES = ( @@ -101,6 +102,13 @@ class PoolMember(octavia_base.OctaviaBase): constraints.CustomConstraint('neutron.subnet') ], ), + TAGS: properties.Schema( + properties.Schema.LIST, + _('A list of simple strings assigned to the member. The property ' + 'is supported with Stein Octavia or newer version.'), + update_allowed=True, + support_status=support.SupportStatus(version='13.0.0'), + ), } def translation_rules(self, props): diff --git a/heat/tests/openstack/octavia/inline_templates.py b/heat/tests/openstack/octavia/inline_templates.py index 9fc65b3431..29ed8f887d 100644 --- a/heat/tests/openstack/octavia/inline_templates.py +++ b/heat/tests/openstack/octavia/inline_templates.py @@ -80,6 +80,7 @@ resources: weight: 1 subnet: sub123 admin_state_up: True + tags: ['tag1', 'tag2'] ''' MONITOR_TEMPLATE = ''' diff --git a/heat/tests/openstack/octavia/test_pool_member.py b/heat/tests/openstack/octavia/test_pool_member.py index 4e48cccc14..a75b3e8081 100644 --- a/heat/tests/openstack/octavia/test_pool_member.py +++ b/heat/tests/openstack/octavia/test_pool_member.py @@ -61,6 +61,7 @@ class PoolMemberTest(common.HeatTestCase): 'weight': 1, 'subnet_id': '123', 'admin_state_up': True, + 'tags': ['tag1', 'tag2'] } } props = self.member.handle_create() @@ -95,6 +96,7 @@ class PoolMemberTest(common.HeatTestCase): prop_diff = { 'admin_state_up': False, 'weight': 2, + 'tags': ['tag3', 'tag4'] } prop_diff = self.member.handle_update(None, None, prop_diff) diff --git a/releasenotes/notes/octavia-member-tags-84cd00224d6b7bc1.yaml b/releasenotes/notes/octavia-member-tags-84cd00224d6b7bc1.yaml new file mode 100644 index 0000000000..83943d2dc4 --- /dev/null +++ b/releasenotes/notes/octavia-member-tags-84cd00224d6b7bc1.yaml @@ -0,0 +1,6 @@ +--- +features: + - Support ``tags`` property for the resource ``OS::Octavia::PoolMember``, the + property is allowed to be updated as well. The resource tag was introduced + in Octavia since Stein release, do not specify tags in Heat template if you are + using the previous versions.