From 31df8c6bf2711fd0d82ad4d9c866ab6e0845de14 Mon Sep 17 00:00:00 2001 From: Nikolay Vinogradov Date: Wed, 12 Oct 2022 07:22:51 +0300 Subject: [PATCH] Add storage-backend subordinate relation Implement initial support for container-scoped storage-backend relation to integrate nova-compute with storage providers. Transition to blocked state if multiple storage backend relations are connected Change-Id: I03e67731df0263887d2d0f671750f420d6e62c1c --- hooks/nova_compute_utils.py | 3 +++ metadata.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hooks/nova_compute_utils.py b/hooks/nova_compute_utils.py index 6dcd548f..8fd56917 100644 --- a/hooks/nova_compute_utils.py +++ b/hooks/nova_compute_utils.py @@ -1000,6 +1000,9 @@ def check_optional_config_and_relations(configs): except ValueError as e: return ('blocked', 'Invalid configuration: {}'.format(str(e))) + if len(relation_ids('storage-backend')) > 1: + return 'blocked', "Multiple storage backends are not supported" + # return 'unknown' as the lowest priority to not clobber an existing # status. return "unknown", "" diff --git a/metadata.yaml b/metadata.yaml index ca1571c3..afbd5ecf 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -54,6 +54,9 @@ requires: interface: vault-kv ironic-api: interface: baremetal + storage-backend: + interface: storage-backend + scope: container peers: compute-peer: interface: nova