code: def export_pod_logs(namespace, label_selector, release_name=None):
      """
      export pod logs with label selector to '/tmp/milvus'
  
      :param namespace: the namespace where the release
      :type namespace: str
  
      :param label_selector: labels to restrict which pods logs to export
      :type label_selector: str
  
      :param release_name: use the release name as server logs director name
      :type label_selector: str
  
      :example:
              >>> export_pod_logs("chaos-testing", "app.kubernetes.io/instance=mic-milvus")
      """
      if isinstance(release_name, str):
          if len(release_name.strip()) == 0:
              raise ValueError("Got an unexpected space release_name")
      else:
          raise TypeError("Got an unexpected non-string release_name")
      pod_log_path = (
          "/tmp/milvus_logs"
          if release_name is None
          else f"/tmp/milvus_logs/{release_name}"
      )
  
      if not os.path.isdir(pod_log_path):
          os.makedirs(pod_log_path)
  
      # get pods and export logs
      items = get_pod_list(namespace, label_selector=label_selector)
      try:
          for item in items:
              pod_name = item.metadata.name
              os.system(
                  f"kubectl logs {pod_name} > {pod_log_path}/{pod_name}.log 2>&1"
              )
      except Exception as e:
          log.error(
              f"Exception when export pod {pod_name} logs: %s\n" % e
          )
          raise Exception(str(e))
  
imports: import json
  import os.path
  import time
  import pyetcd
  import requests
  from pymilvus import connections
  from kubernetes import client, config
  from kubernetes.client.rest import ApiException
  from common.milvus_sys import MilvusSys
  from utils.util_log import test_log
  from chaos import chaos_commons
  from common.common_type import in_cluster_env
label_desc: Use image node_id 9 for calling a global function with example usage: export_pod_logs(namespace, label_selector, release_name) without return types