Browse Source

Merge "Avoid race when pod is deleted before finalizer is added"

changes/32/754732/1
Zuul 10 months ago
committed by Gerrit Code Review
parent
commit
084fe6c415
  1. 6
      kuryr_kubernetes/k8s_client.py

6
kuryr_kubernetes/k8s_client.py

@ -271,7 +271,11 @@ class K8sClient(object):
# Object is being deleting or gone. Return.
return False
except exc.K8sConflict:
obj = self.get(path)
try:
obj = self.get(path)
except exc.K8sResourceNotFound:
# Object got removed before finalizer was set
return False
if finalizer in obj['metadata'].get('finalizers', []):
# Finalizer is there, return.
return True

Loading…
Cancel
Save