コード例 #1
0
 def _extract_properties(self, entity):
     properties = {}
     properties['status'] = entity['status']
     properties['severity'] = entity['labels']['severity']
     properties['message'] = str_utils.escape(
         entity['annotations']['message'])
     return properties
コード例 #2
0
 def _extract_message(self, entity):
     annotations = self._extract_annotations(entity)
     message = annotations.get('message')
     if not message:
         message = annotations.get('summary')
     if message:
         return str_utils.escape(message)
コード例 #3
0
ファイル: extractor.py プロジェクト: k-wiatrzyk/orca
 def _extract_containers(self, entity):
     containers = []
     for container in entity.spec.containers:
         properties = {}
         properties['name'] = container.name
         properties['image'] = container.image
         properties['command'] = None
         if container.command:
             properties['command'] = str_utils.escape(" ".join(container.command))
         properties['env'] = self._extract_env(container)
         properties['env_from'] = None
         if container.env_from:
             properties['env_from'] = [env.to_dict() for env in container.env_from]
         containers.append(properties)
     return containers
コード例 #4
0
 def _extract_properties(self, entity):
     properties = {}
     properties['status'] = 'active'
     properties['severity'] = entity['severity']
     properties['message'] = str_utils.escape(entity['message'])
     return properties