Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNKNOWN_BASE_TYPE in documentation for patch_* methods #1020

Closed
rihardsk opened this issue Nov 27, 2019 · 13 comments
Closed

UNKNOWN_BASE_TYPE in documentation for patch_* methods #1020

rihardsk opened this issue Nov 27, 2019 · 13 comments
Assignees
Labels
kind/documentation Categorizes issue or PR as related to documentation. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@rihardsk
Copy link

Link to the issue (please include a link to the specific documentation or example):
https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/AppsV1Api.md#patch_namespaced_deployment_scale and other patch_* methods.

Description of the issue (please include outputs or screenshots if possible):
The type for the method's body parameter is UNKNOWN_BASE_TYPE. It's not clear to me what to pass to the method (i'm guessing V1Scale in this instance).

@rihardsk rihardsk added the kind/documentation Categorizes issue or PR as related to documentation. label Nov 27, 2019
@xiaomaimuchanyiyiba
Copy link

It's not clear to me too

@yuri-stepanov
Copy link

JFYI, I have tried to V1Scale, but it doesnt work apparently, so I just passing {"spec": {"replicas": 3}. Seems to do the trick.

@roycaihw
Copy link
Member

roycaihw commented Dec 3, 2019

cc @tomplus

/assign

@roycaihw
Copy link
Member

roycaihw commented Dec 3, 2019

There was no UNKNOWN_BASE_TYPE in 10.0 client (Kubernetes 1.14). This looks like a regression introduced by either openapi-generator or Kubernetes 1.15.

@tomplus
Copy link
Member

tomplus commented Dec 4, 2019

It looks like openapi-generator insert it when the spec doesn't define the content-type:

https://github.com/OpenAPITools/openapi-generator/blob/c882338ef134e9c00a02fed2d2792b7eda36ea95/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L4981-L4987

In v10 we have NULL which is also incorrect:

https://github.com/kubernetes-client/python/blob/release-10.0/kubernetes/docs/AppsV1Api.md#patch_namespaced_deployment_scale

The content-type in patch_ methods depends on the requester (ref: #959) and we have to agree that our auto-generated docs don't work well and need to be re-written (ref: #601).

@logicbomb421
Copy link

Running into this problem myself. Will the documentation be regenerated soon, or is there different documentation I can look at? Pretty new to interacting with the API directly, so not having documentation on what the body of a request should look like is somewhat tough.

@avbanks
Copy link

avbanks commented Jan 9, 2020

If anyone runs in to this issue a good way to find out what api object is needed is to edit the resource in question with kubectl edit -v 9

ex : if we wanted to patch the annotations in a pod run:

kubectl edit pod vault-test -v 9
then edit the annotation add test: test
now note the line "Request Body: Request Body: {"metadata":{"annotations":{"test":test}}}"

This tells you what the body of the patch needs to be for the particular patch you're requesting (in the example case we're annotating metadata).

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 6, 2020
@hantmac
Copy link

hantmac commented May 7, 2020

Running into this problem, confusing too. 😭

@nrmitchi
Copy link

I ran into this as well last, but I think I've gotten it for the most part figured out.

The way that this is now displayed in the docs (UNKNOWN_BASE_TYPE) is implying that there is a given object type that should be there.

I believe that the body of all of these request types is just meant to be an arbitrary dict, containing the same information that would be present by patch-ing a resource with kubectl: Ie,

kubectl patch deployment <name> -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 11, 2020
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests