python icon indicating copy to clipboard operation
python copied to clipboard

Target_Port parameter type reference is a broken link

Open rezuma opened this issue 3 years ago • 13 comments

Link to the issue (please include a link to the specific documentation or example): https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1ServicePort.md

Description of the issue (please include outputs or screenshots if possible): The documentation of the V1ServicePort defines target_port type as object. The link on the word object links is broken so the audience cant understand what that object is This is the link https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/.md on the object word

Thanks

rezuma avatar Oct 26 '21 20:10 rezuma

@roycaihw is the redirection link this one https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1ServiceBackendPort.md to replace with

DiptoChakrabarty avatar Oct 29 '21 06:10 DiptoChakrabarty

target_port is an IntOrString.

Fundamentally this is a shortcoming of Kubernetes using OpenAPI v2, which cannot properly express the schema of an "int or string" type, nor let us generate the correct client-side validation. People had put workarounds for the client-side validation (https://github.com/kubernetes-client/gen/pull/26, https://github.com/kubernetes-client/gen/pull/30), but the documentation became somewhat broken (also see Java example)

A short-term fix for the Python client can be appending the documentation of IntOrString to v["description"]. Other suggestions are welcome.

/help

roycaihw avatar Oct 29 '21 22:10 roycaihw

@roycaihw: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to this:

target_port is an IntOrString.

Fundamentally this is a shortcoming of Kubernetes using OpenAPI v2, which cannot properly express the schema of an "int or string" type, nor let us generate the correct client-side validation. People had put workarounds for the client-side validation (https://github.com/kubernetes-client/gen/pull/26, https://github.com/kubernetes-client/gen/pull/30), but the documentation became somewhat broken (also see Java example)

A short-term fix for the Python client can be appending the documentation of IntOrString to v["description"]. Other suggestions are welcome.

/help

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.

k8s-ci-robot avatar Oct 29 '21 22:10 k8s-ci-robot

@jefftree I wonder if you know any effort to change the schema of IntOrString when Kubernetes goes OpenAPI v3. Currently it looks like this:

"io.k8s.apimachinery.pkg.util.intstr.IntOrString": {                                                                                
  "description": "IntOrString is a type that can hold an int32 or a string.  When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type.  This allows you to have, for example, a JSON field that can accept a name or number.",
  "format": "int-or-string",
  "type": "string"                                                                                                                  
},

roycaihw avatar Oct 29 '21 22:10 roycaihw

OpenAPI V3 should be able to use the new oneOf annotation and correctly indicate the type as oneOf {int, string}.

Thanks for bringing this up, I was actually unaware of this struct and originally thought all IntOrString operations went through the x-int-or-string extension. Will add it to the agenda for OpenAPI :)

Jefftree avatar Oct 30 '21 02:10 Jefftree

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jan 30 '22 19:01 k8s-triage-robot

/assign

anchal00 avatar Feb 09 '22 08:02 anchal00

/assign

RBCL avatar Feb 11 '22 17:02 RBCL

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Mar 13 '22 18:03 k8s-triage-robot

Hi, just want to give a quick update around OpenAPI V3. OpenAPI v3 is now beta in kubernetes and will be enabled by default. The spec is split by group/version and the discovery endpoint can be found at /openapi/v3.

We also have generated files committed to the k/k repo split by group version. IntOrString is properly defined in OpenAPI V3 (https://github.com/kubernetes/kubernetes/blob/master/api/openapi-spec/v3/apis__apps__v1_openapi.json#L6034-L6046), let me know if I can provide any help with integration.

Jefftree avatar Mar 31 '22 00:03 Jefftree

/remove-lifecycle rotten

Jefftree avatar Mar 31 '22 00:03 Jefftree

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 29 '22 00:06 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jul 29 '22 01:07 k8s-triage-robot

Hello! I want to know if anyone working on this issue.

Mohdcode avatar Aug 14 '22 15:08 Mohdcode

could you tell me the issue as it's my first time on an open source project? as I couldn't understand the upper conversation cuz it's little cryptic to me.

Mohdcode avatar Aug 14 '22 15:08 Mohdcode

/remove lifecycle rotten

Mohdcode avatar Aug 14 '22 16:08 Mohdcode

I want to start contributing in this project. And I am a total beginner. So it would be great if u could suggest some resources to start with.

Ashutosh-20 avatar Aug 16 '22 15:08 Ashutosh-20

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Sep 15 '22 16:09 k8s-triage-robot

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/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.

k8s-ci-robot avatar Sep 15 '22 16:09 k8s-ci-robot