Browse Source

Merge "Use default subnet if another is not specified in NAD"

tags/0.6.1
Zuul 5 months ago
parent
commit
110018d952
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      kuryr_kubernetes/controller/drivers/multi_vif.py

+ 5
- 1
kuryr_kubernetes/controller/drivers/multi_vif.py View File

@@ -16,6 +16,7 @@ from oslo_log import log as logging
16 16
 from oslo_serialization import jsonutils
17 17
 
18 18
 from kuryr_kubernetes import clients
19
+from kuryr_kubernetes import config as kuryr_config
19 20
 from kuryr_kubernetes import constants
20 21
 from kuryr_kubernetes.controller.drivers import base
21 22
 from kuryr_kubernetes import exceptions
@@ -64,7 +65,10 @@ class NPWGMultiVIFDriver(base.MultiVIFDriver):
64 65
 
65 66
             config = jsonutils.loads(nad_obj['metadata']['annotations']
66 67
                                      ['openstack.org/kuryr-config'])
67
-            subnet_id = config[constants.K8S_ANNOTATION_NPWG_CRD_SUBNET_ID]
68
+            subnet_id = config.get(
69
+                constants.K8S_ANNOTATION_NPWG_CRD_SUBNET_ID,
70
+                kuryr_config.CONF.neutron_defaults.pod_subnet
71
+                )
68 72
             subnet = {subnet_id: utils.get_subnet(subnet_id)}
69 73
             if constants.K8S_ANNOTATION_NPWG_CRD_DRIVER_TYPE not in config:
70 74
                 vif_drv = self._drv_vif_pool

Loading…
Cancel
Save