diff --git a/notifier/operator/resource_claim.py b/notifier/operator/resource_claim.py index 272fb87d..f51e459f 100644 --- a/notifier/operator/resource_claim.py +++ b/notifier/operator/resource_claim.py @@ -37,14 +37,14 @@ def annotations(self): def catalog_item_name(self): return self.definition.get('status', {}).get('summary', {}).get( 'catalog_item_name', - self.definition['metadata'].get('labels', {}).get('babylon.gpte.redhat.com/catalogItemName') + self.labels.get('babylon.gpte.redhat.com/catalogItemName') ) @property def catalog_item_namespace(self): return self.definition.get('status', {}).get('summary', {}).get( 'catalog_item_namespace', - self.definition['metadata'].get('labels', {}).get('babylon.gpte.redhat.com/catalogItemNamespace') + self.labels.get('babylon.gpte.redhat.com/catalogItemNamespace') ) @property @@ -85,6 +85,10 @@ def is_stopped(self): return False return stopped + @property + def labels(self): + return self.definition['metadata'].get('labels', {}) + @property def last_started_timestamp(self): if not 'status' in self.definition \