summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-08 14:19:13 +0000
committerGerrit Code Review <review@openstack.org>2019-01-08 14:19:13 +0000
commit110018d9520f518718d4d97c1a96564581129c8d (patch)
treef5eaef84bffae1e8f2b87ab4aad7fff9fecd4cfe
parent2320e43122bb0ac1aa105a191b902d2e0a3e0505 (diff)
parent558eff14252eee86f87f68561b1167fa9425502e (diff)
Merge "Use default subnet if another is not specified in NAD"
-rw-r--r--kuryr_kubernetes/controller/drivers/multi_vif.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/kuryr_kubernetes/controller/drivers/multi_vif.py b/kuryr_kubernetes/controller/drivers/multi_vif.py
index 4258607..ced25b7 100644
--- a/kuryr_kubernetes/controller/drivers/multi_vif.py
+++ b/kuryr_kubernetes/controller/drivers/multi_vif.py
@@ -16,6 +16,7 @@ from oslo_log import log as logging
16from oslo_serialization import jsonutils 16from oslo_serialization import jsonutils
17 17
18from kuryr_kubernetes import clients 18from kuryr_kubernetes import clients
19from kuryr_kubernetes import config as kuryr_config
19from kuryr_kubernetes import constants 20from kuryr_kubernetes import constants
20from kuryr_kubernetes.controller.drivers import base 21from kuryr_kubernetes.controller.drivers import base
21from kuryr_kubernetes import exceptions 22from kuryr_kubernetes import exceptions
@@ -64,7 +65,10 @@ class NPWGMultiVIFDriver(base.MultiVIFDriver):
64 65
65 config = jsonutils.loads(nad_obj['metadata']['annotations'] 66 config = jsonutils.loads(nad_obj['metadata']['annotations']
66 ['openstack.org/kuryr-config']) 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 subnet = {subnet_id: utils.get_subnet(subnet_id)} 72 subnet = {subnet_id: utils.get_subnet(subnet_id)}
69 if constants.K8S_ANNOTATION_NPWG_CRD_DRIVER_TYPE not in config: 73 if constants.K8S_ANNOTATION_NPWG_CRD_DRIVER_TYPE not in config:
70 vif_drv = self._drv_vif_pool 74 vif_drv = self._drv_vif_pool