Skip to content

Errors from k8s api lost during object deserialization #745

Closed
@dever4eg

Description

@dever4eg

Describe the bug

Errors from k8s api lost during object deserialization in BatchV1Api

Client Version
e.g. 0.16.1

Server Version
e.g. 1.19.1

To Reproduce

Make request which will return error from k8s api

Expected behavior

Error body is present in error.response.body

Example Code

In this part of BatchV1Api, deserialization should be inside if statement. Because in case of error from Kubernetes API, error body will be mapped to success result object, and helpful info about error will be lost.

Screenshot 2021-11-23 at 18 24 33

Environment (please complete the following information):

  • OS: Mac OS
  • NodeJS Version 14
  • Cloud runtime: Azure K8S

Additional context

Here is an issue in openapi-generator which is used in kubernetes-client
OpenAPITools/openapi-generator#2924

And here is my PR
OpenAPITools/openapi-generator#10940

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions