Skip to content

V1ServicePort with wrong type for targetPort #666

Closed
kubernetes-client/gen
#213
@Saeger

Description

@Saeger

Describe the bug
The "targetPort" type is defined as "object" while the possibility of values can be both number and string.
With this said, you can't set a type for a variable and fill targetPort with a number the way it's implemented.
"Type 'number' is not assignable to type 'object'.ts(2322)"

** Client Version **
0.14.3

** Server Version **
1.18.0

To Reproduce
Steps to reproduce the behavior:
Define a variable of type V1Service and try to make the specs for ports.

Expected behavior
The type definition could be defined as number | string since both are supported.

** Example Code**
ports: [ { name: 'http', port: 80, targetPort: 3000, protocol: 'TCP', }, ],

Environment (please complete the following information):

  • OS: OSX
  • NodeJS Version 14

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions