def list_pods(self, namespace, labels=None, deployment_name=None, selector=None):
        """
            https://github.com/kubernetes-incubator/client-python/blob/master/kubernetes/docs/
            CoreV1Api.md#list_namespaced_pod
            If deployment_name is provided, it will ignore selector, and use the deployment's
        """
        try:
            selector = self.selector_or_labels(labels, selector)
            if deployment_name:
                deployment = self.get_deployment(namespace, deployment_name)
                selector = self.dict_to_selector(deployment.spec.selector.match_labels)
            return self.client_corev1api.list_namespaced_pod(
                namespace=namespace,
                label_selector=selector,
            ).items
        except ApiException as e:
            self.logger.exception(e)
            raise

            https://github.com/kubernetes-incubator/client-python/blob/master/kubernetes/docs/
            CoreV1Api.md#list_namespaced_pod
            If deployment_name is provided, it will ignore selector, and use the deployment's
        
powerfulseal/k8s/k8s_client.py