Thanks to visit codestin.com
Credit goes to github.com

Skip to content

create horizontal_pod_autoscaler error, conditions must not be None #1200

Closed
@yylt

Description

@yylt

What happened (please include outputs or screenshots):

 spec = client.V2beta2HorizontalPodAutoscalerSpec(
            max_replicas=max_num,
            min_replicas=min_num,
            scale_target_ref=client.V2beta2CrossVersionObjectReference(
                api_version='apps/v1',
                kind='Deployment',
                name=name,
            ),
            metrics=v2beta2MetricSpecs,
        )
        meta = k8sobject.build_metadata(name=name, namespace=namespace)
        body = client.V2beta2HorizontalPodAutoscaler(
            metadata=meta,
            spec=spec,
        )

        return self._k8s.create_group_version_object('Autoscaling',
                                                     'V2beta2',
                                                     'horizontal_pod_autoscaler',
                                                     body)
Traceback:
...
  File "/usr/lib/python2.7/site-packages/kubernetes/client/api/autoscaling_v2beta2_api.py", line 58, in create_namespaced_horizontal_pod_autoscaler
    (data) = self.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, **kwargs)  # noqa: E501
  File "/usr/lib/python2.7/site-packages/kubernetes/client/api/autoscaling_v2beta2_api.py", line 149, in create_namespaced_horizontal_pod_autoscaler_with_http_info
    collection_formats=collection_formats)
  File "/usr/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 345, in call_api
    _preload_content, _request_timeout)
  File "/usr/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 184, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/usr/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 256, in deserialize
    return self.__deserialize(data, response_type)
  File "/usr/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 295, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 636, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/usr/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 295, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 638, in __deserialize_model
    instance = klass(**kwargs)
  File "/usr/lib/python2.7/site-packages/kubernetes/client/models/v2beta2_horizontal_pod_autoscaler_status.py", line 62, in __init__
    self.conditions = conditions
  File "/usr/lib/python2.7/site-packages/kubernetes/client/models/v2beta2_horizontal_pod_autoscaler_status.py", line 93, in conditions
    raise ValueError("Invalid value for `conditions`, must not be `None`")  # noqa: E501
ValueError: Invalid value for `conditions`, must not be `None`

What you expected to happen:
create success

How to reproduce it (as minimally and precisely as possible):
create v2beta2 hpa resource

Anything else we need to know?:

Environment:

  • Kubernetes version (kubectl version):

Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6", GitCommit:"85ec80c3a5e1d28f947972e7d6c95d5b72ee2a14", GitTreeState:"clean", BuildDate:"2020-05-19T02:40:43Z", GoVersion:"go1.14.2", Compiler:"gc", Platform:"linux/amd64"

  • OS (e.g., MacOS 10.13.6):
  • Python version (python --version)
  • Python client version (pip list | grep kubernetes)

kubernetes (11.0.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions