Python: ValueError("Invalid value for `match_expressions`, must not be `None`") when calling kubernetes.client.CoreV1Api().list_namespaced_pod

Created on 5 Dec 2018  路  7Comments  路  Source: kubernetes-client/python

When I try using the kubernetes.client.CoreV1Api().list_namespaced_pod method, I get the error:

  File "xxx/lib/python3.6/site-packages/kubernetes/client/models/v1_node_selector_term.py", line 49, in __init__
    self.match_expressions = match_expressions
  File "xxx/lib/python3.6/site-packages/kubernetes/client/models/v1_node_selector_term.py", line 72, in match_expressions
    raise ValueError("Invalid value for `match_expressions`, must not be `None`")
ValueError: Invalid value for `match_expressions`, must not be `None`

the way of calling method:

kubernetes.client.CoreV1Api().list_namespaced_pod(namespace="kube-system")

I'm just trying to list all pods for kube-system namespaces

I'm using Python 3.6 with Kubernetes 1.12.2 and kubernetes-client v5.0.0锛宎nd I've tried kubernetes-client v6.1.0

lifecyclstale

Most helpful comment

problem sovled by using version v8.0.0, thx! @micw523

All 7 comments

Please check the compatibility matrix - I suggest using v7 or higher for k8s 1.12.2

ok, I will try v7 or higher version, thx

problem sovled by using version v8.0.0, thx! @micw523

when i try using the kubernetes.client.CoreV1Api().list_pod_for_all_namespaces(watch=False) method I get the error too:

ValueError: Invalid value for `match_expressions`, must not be `None`

I'm just trying to list all pods

I'm using Python 2.7.5 with Kubernetes 1.13.2-2 and kubernetes-client v9.0.0

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/close

@liwandaniel: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Was this page helpful?
0 / 5 - 0 ratings