Skip to content

Client does not accept null subsets in endpoint objects #463

@hanikesn

Description

@hanikesn

Neither version 4.0.0 nor 5.0.0 accept Endpoint objects from kubernetes 1.8, which don't have any endpoints defined. According to the official documentation json clients should accept both empty arrays as well as null values.

See:

Protobuf serialization does not distinguish between [] and null.
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.8.md#action-required-2

apiVersion: v1
kind: Endpoints
metadata:
  creationTimestamp: 2017-12-08T13:33:24Z
  labels:
    app: zero-test
    expose: http
  name: zero-test
  namespace: default
  resourceVersion: "40308257"
  selfLink: /api/v1/namespaces/default/endpoints/zero-test
  uid: 5d47e6c7-dc1c-11e7-85ba-0244ea825020
subsets: null
  File "/home/steffen/dev/ingress-nginx-plus/env/lib/python3.6/site-packages/kubernetes/client/models/v1_endpoints.py", line 64, in __init__
    self.subsets = subsets
  File "/home/steffen/dev/ingress-nginx-plus/env/lib/python3.6/site-packages/kubernetes/client/models/v1_endpoints.py", line 156, in subsets
    raise ValueError("Invalid value for `subsets`, must not be `None`")
ValueError: Invalid value for `subsets`, must not be `None`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions