8000 Delete namespace does not return proper v1.Status object · Issue #69970 · kubernetes/kubernetes · GitHub
[go: up one dir, main page]

Skip to content

Delete namespace does not return proper v1.Status object #69970

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

Closed
JohannesRudolph opened this issue Oct 18, 2018 · 4 comments
Closed

Delete namespace does not return proper v1.Status object #69970

JohannesRudolph opened this issue Oct 18, 2018 · 4 comments
8000
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@JohannesRudolph
Copy link

/kind bug

What happened:

I tried to delete a namespace via https://github.com/kubernetes-client/java and was hit by a gnarly error when the lib tried to deserialize the returned body

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 321 path $.status

So I dug into the API repsonses and found out that indeed something appears to be wrong in the swagger spec + official API documentation. According to DELETE namespace docs the response should be a Status v1 meta object. However, the returned response looks actually like this:

12:24 $ kubectl --v 8 delete namespace aafs-dxbd85
I1018 12:26:16.686420   10111 loader.go:357] Config loaded from file /home/jrudolph/dev/mc/infrastructure/kubernetes/cluster.kubeconfig
I1018 12:26:16.691791   10111 request.go:874] Request Body: {"orphanDependents":false}
I1018 12:26:16.691852   10111 round_trippers.go:383] DELETE https://k8s.dev.eu-de-central.msh.host:6443/api/v1/namespaces/aafs-dxbd85
I1018 12:26:16.691858   10111 round_trippers.go:390] Request Headers:
I1018 12:26:16.691861   10111 round_trippers.go:393]     User-Agent: kubectl/v1.10.1 (linux/amd64) kubernetes/d4ab475
I1018 12:26:16.691864   10111 round_trippers.go:393]     Content-Type: application/json
I1018 12:26:16.691866   10111 round_trippers.go:393]     Accept: application/json
I1018 12:26:16.924556   10111 round_trippers.go:408] Response Status: 202 Accepted in 232 milliseconds
I1018 12:26:16.924592   10111 round_trippers.go:411] Response Headers:
I1018 12:26:16.924599   10111 round_trippers.go:414]     Content-Type: application/json
I1018 12:26:16.924604   10111 round_trippers.go:414]     Content-Length: 344
I1018 12:26:16.924609   10111 round_trippers.go:414]     Date: Thu, 18 Oct 2018 10:26:16 GMT
I1018 12:26:16.924643   10111 request.go:874] Response Body: {"kind":"Namespace","apiVersion":"v1","metadata":{"name":"aafs-dxbd85","selfLink":"/api/v1/namespaces/aafs-dxbd85","uid":"19326fb3-d2bd-11e8-97ef-fa163e607805","resourceVersion":"77243","creationTimestamp":"2018-10-18T10:03:44Z","deletionTimestamp":"2018-10-18T10:26:16Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Terminating"}}

The status field should be a string of either "Success" or "Failure" according to docs + swagger spec, but it's actually an object status":{"phase":"Terminating"}.

What you expected to happen:

The status field should be a string.

How to reproduce it (as minimally and precisely as possible):

Create a namespace, delete it, observe status field content in output

kubectl create namespace aafs-dxbd85
kubectl --v 8 delete namespace aafs-dxbd85

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): server 1.11.3, client 1.10.1
  • Install tools: RKE
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 18, 2018
@JohannesRudolph
Copy link
Author

@kubernetes/sig-api-machinery-bugs

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 18, 2018
@k8s-ci-robot
Copy link
Contributor

@JohannesRudolph: Reiterating the mentions to trigger a notification:
@kubernetes/sig-api-machinery 8000 -bugs

In response to this:

@kubernetes/sig-api-machinery-bugs

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.

@liggitt
Copy link
Member
liggitt commented Oct 18, 2018

The bug is in the generated openapi spec. This is a duplicate of #59501

The behavior is intentional, configured here:

/close

@k8s-ci-robot
Copy link
Contributor

@liggitt: Closing this issue.

In response to this:

The bug is in the generated openapi spec. This is a duplicate of #59501

The behavior is intentional, configured here:

/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/bug Categorizes issue or PR as related to a bug. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

3 participants
0