Merge "Avoid race between pod creation retry and namespace deletion" into stable/train
This commit is contained in:
commit
df5d7cbd0f
|
@ -92,8 +92,16 @@ class VIFHandler(k8s_base.ResourceEventHandler):
|
|||
project_id = self._drv_project.get_project(pod)
|
||||
security_groups = self._drv_sg.get_security_groups(pod, project_id)
|
||||
if not state:
|
||||
subnets = self._drv_subnets.get_subnets(pod, project_id)
|
||||
|
||||
try:
|
||||
subnets = self._drv_subnets.get_subnets(pod, project_id)
|
||||
except n_exc.NotFound:
|
||||
LOG.warning("Subnet does not exists. If namespace driver is "
|
||||
"used, probably the namespace for the pod is "
|
||||
"already deleted. So this pod does not need to "
|
||||
"get a port as it will be deleted too. If the "
|
||||
"default subnet driver is used, then you must "
|
||||
"select an existing subnet to be used by Kuryr.")
|
||||
return
|
||||
# Request the default interface of pod
|
||||
main_vif = self._drv_vif_pool.request_vif(
|
||||
pod, project_id, subnets, security_groups)
|
||||
|
|
Loading…
Reference in New Issue