k8s - safely retrieve object data

This commit is contained in:
florian 2024-02-05 21:43:23 +01:00
parent 3fea652b5d
commit 4176411d18
No known key found for this signature in database
GPG key ID: 93EE47CC3D061500

View file

@ -232,7 +232,7 @@ class IngressController(Controller):
obj = event["object"]
metadata = obj.metadata if obj else None
annotations = metadata.annotations if metadata else None
data = obj.data if obj else None
data = getattr(obj, 'data', None) if obj else None
if not obj:
return False
if obj.kind == "Pod":