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

kubectl edit job returns apiVersion: extensions/v1beta1 #22517

Closed
soltysh opened this issue Mar 4, 2016 · 9 comments
Closed

kubectl edit job returns apiVersion: extensions/v1beta1 #22517

soltysh opened this issue Mar 4, 2016 · 9 comments
Assignees
Labels
area/kubectl kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@soltysh
Copy link
Contributor

soltysh commented Mar 4, 2016

Steps to reproduces:

kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
kubectl edit job/pi

In the editor you'll see apiVersion: extensions/v1beta1 instead of batch/v1. It does not matter if you create a job using above command or if you create one with explicit `batch/v1.

@erictune

@soltysh soltysh changed the title kubectl edit returns apiVersion: extensions/v1beta1 kubectl edit job returns apiVersion: extensions/v1beta1 Mar 4, 2016
@adohe-zz
Copy link

adohe-zz commented Mar 5, 2016

I think we should keep this on 1.2

@bgrant0607 bgrant0607 added kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. area/kubectl labels May 6, 2016
@dims
Copy link
Member

dims commented May 18, 2016

kubectl get job/pi -o yaml also gives the wrong apiVersion

@dims
Copy link
Member

dims commented May 18, 2016

kubectl is making the following calls

I0518 17:44:26.983681 13465 handlers.go:161] GET /apis/batch/v1/jobs?resourceVersion=0: (924.71µs) 200 [[hyperkube/v1.3.0 (linux/amd64) kubernetes/952e830/job-controller] 127.0.0.1:33560] I0518 17:44:43.958482 13465 handlers.go:161] GET /apis/extensions/v1beta1/namespaces/default/jobs/pi: (593.349µs) 200 [[kubectl/v1.3.0 (linux/amd64) kubernetes/952e830] 127.0.0.1:33568]

the json response from /apis/batch/v1/jobs?resourceVersion=0 is good (correct namespace and resource path for job/pi). So looks like kubectl is turning around and calling the wrong resource

Also calling curl http://localhost:8080/apis/batch/v1/namespaces/default/jobs/pi gives the correct namespace.

cc @janetkuo

@soltysh
Copy link
Contributor Author

soltysh commented May 19, 2016

@dims the reason for that is that jobs co-exists in both extensions and batch groups. We left extensions for backwards compatibility. If you're able to find some time and fix this, PRs are welcome :)

dims added a commit to dims/kubernetes that referenced this issue May 20, 2016
"Jobs" co-exists in both extensions and batch groups for backwards
compatability. While looking up apiVersion let's make sure that
we have higher priority for the newer API version.

Fixes Issue kubernetes#22517
@dims
Copy link
Member

dims commented May 20, 2016

@soltysh - Took a while to debug to get the bare minimum change that at least works with kubectl get job/pi -o yaml

@adohe-zz
Copy link

@dims @soltysh any updates on this? should I pick this up?

@dims
Copy link
Member

dims commented Dec 10, 2016

@adohe go for it!

@soltysh
Copy link
Contributor Author

soltysh commented Dec 12, 2016

@adohe I'd leave it for now, since I'm closing the PR which removes extensions/v1beta1.Jobs entirely and the problem should be gone with it.

@soltysh soltysh self-assigned this Dec 12, 2016
@soltysh
Copy link
Contributor Author

soltysh commented Feb 3, 2017

extensions/v1beta1.Jobs were removed in #38614.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

5 participants