testshift.resources.pod

Module Contents

class testshift.resources.pod.Pod(name=None, namespace=None, label_selector=None)

Bases: testshift.resources.base.Resource

Pod class instantiates an OCP pod resource.

Parameters
  • name (str) – Pod’s name as found in pod.metadata

  • namespace (str) – Namespace where the pod is running

  • label_selector (str) – Label selector as used in oc command

Raises
  • RuntimeError – When only namespace is passed as argument.

  • ResourceNotFoundException – When OCP API returns resource not found.

Examples

>>> pod = Pod(label_selector='pod-template-hash=79fc6c4cb7')
>>> pod.exists
True
>>> pod.is_running
True
property exists(self)

bool: Whether pods were found or not.

property is_running(self)

bool: Check for the status phase of all the pods

property count(self)

int: Amount of pods found by the search criteria