Browse Source

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

changes/32/754732/1
Zuul 7 months ago
committed by Gerrit Code Review
parent
commit
084fe6c415
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      kuryr_kubernetes/k8s_client.py

+ 5
- 1
kuryr_kubernetes/k8s_client.py View File

@ -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