def find_deployments(self, namespace=None, labels=None):
        """ Find deployments for a namespace (default to "default" namespace).
        """
        deployments = []
        for ns in self.preprocess_namespace(namespace):
            try:
                for item in self.k8s_client.list_deployments(
                    namespace=ns,
                    labels=labels,
                ):
                    deployments.append(item.metadata.name)
            except Exception as e:
                self.logger.exception(e)
        return deployments
 Find deployments for a namespace (default to "default" namespace).
        
powerfulseal/k8s/k8s_inventory.py