Optional parameter is required in some processes

Bug #2025007 reported by Masaki UENO
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
New
Undecided
Unassigned

Bug Description

Current implementation has the below bug:

`metadata` field in VnfInstanceV2 is accessed at [1] during DB synchronization.

```
    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')
```

This field is optional (i.e. cardinality of this field is `0..1` in SOL002/003 specification), but this process has no None check. This results in a below bug when processing VNF instances with no `metadata` value.

```
2023-06-14 04:32:56.294 1 ERROR tacker.sol_refactored.conductor.conductor_v2 [None req-03b13adc-af42-4438-8bed-7ab72cf6e510 - - - - - -] Failed to synchronize database vnf: 399216ac-06bd-4ad6-8f54-ecc8e35f36b9 Error: Cannot load 'metadata' in the base class: NotImplementedError: Cannot load 'metadata' in the base class
```

We can resolve this issue by getting namespace from `vnf_instance.instantiatedVnfInfo.metadata['namespace']`.

[1] https://github.com/openstack/tacker/blob/stable/2023.1/tacker/sol_refactored/infra_drivers/kubernetes/kubernetes_common.py#L319

description: updated
Navum Gupta (navum)
Changed in tacker:
assignee: nobody → Navum Gupta (navum)
Revision history for this message
Navum Gupta (navum) wrote :

I am working on this bug

Navum Gupta (navum)
Changed in tacker:
assignee: Navum Gupta (navum) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 10.0.0.0rc1

This issue was fixed in the openstack/tacker 10.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.