Fix cannot get namespace when executing DB Sync

When DB sync is executed, the namespace of the vnf instance must be
obtained. The current code gets the namespace in the wrong place.
This patch fixes the bug to get namespace from correct place.

Closes-Bug: #2025007
Change-Id: Ic107d78a298c6f10932936700a3d7a33887af5e4
This commit is contained in:
Shuwen Cai 2023-07-06 10:48:32 +09:00
parent fe0807231d
commit 3416148ca6
1 changed files with 1 additions and 1 deletions

View File

@ -316,7 +316,7 @@ class KubernetesCommon(object):
def _get_pod_information(self, resource_name,
resource_type, vnf_instance, vim_connection_info):
"""Extract a Pod starting with the specified 'resource_name' name"""
namespace = vnf_instance.metadata.get('namespace')
namespace = vnf_instance.instantiatedVnfInfo.metadata.get('namespace')
if not namespace:
namespace = "default"