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 apply and edit are broken for TPR #40119
Comments
|
+1 kubectl apply is an unrecognized command: |
|
@edsiper You seem to have a custom built version. Where did you obtain your kubectl? |
|
deb package: repository: per instructions from: https://kubernetes.io/docs/getting-started-guides/kubeadm/ |
|
my "kubectl apply" issue is solved (my bad), I had an old-local/custom kubectl in /usr/local/bin/ messing up the things. |
|
Thanks @ymqytw for creating this issue. Would you be interested in that approach ?
I am playing around with adding some tests that reproduce these behavior. Please let me know if you agree/ disagree. |
|
@ahakanbaba That sounds reasonable to me. But I'm not sure how to add some disabled tests.
Please feel free to create a PR for the tests, if you already have some. cc me in that PR. Thanks. |
Automatic merge from submit-queue (batch tested with PRs 39223, 40260, 40082, 40389) make kubectl generic commands work with unstructured objects part of making apply, edit, label, annotate, and patch work with third party resources fixes #35149 fixes #34413 prereq of: #35496 #40096 related to: #39906 #40119 kubectl is currently decoding any resource it doesn't have compiled-in to a ThirdPartyResourceData struct, which means it computes patches using that struct, and would try to send a ThirdPartyResourceData object to the API server when running `apply` This PR removes the behavior that decodes unknown objects into ThirdPartyResourceData structs internally, and fixes up the following generic commands to work with unstructured objects - [x] apply - [x] decode into runtime.Unstructured objects - [x] successfully use `--record` with unregistered objects - [x] patch - [x] decode into runtime.Unstructured objects - [x] successfully use `--record` with unregistered objects - [x] describe - [x] decode into runtime.Unstructured objects - [x] implement generic describer - [x] fix other generic kubectl commands to work with unstructured objects - [x] label - [x] annotate follow-ups for pre-existing issues: - [ ] `explain` doesn't work with unregistered resources - [ ] remove special casing of federation group in clientset lookups, etc - [ ] `patch` - [ ] doesn't honor output formats when persisting to server (`kubectl patch -f svc.json --type merge -p '{}' -o json` doesn't output json) - [ ] --local throws exception (`kubectl patch -f svc.json --type merge -p '{}' --local`) - [ ] `apply` - [ ] fall back to generic JSON patch computation if no go struct is registered for the target GVK (e.g. #40096) - [ ] ensure subkey deletion works in CreateThreeWayJSONMergePatch - [ ] ensure type stomping works in CreateThreeWayJSONMergePatch - [ ] lots of tests for generic json patch computation - [ ] prevent generic apply patch computation among different versions - [ ] reconcile treatment of nulls with #35496 - [ ] `edit` - [ ] decode into runtime.Unstructured objects - [ ] fall back to generic JSON patch computation if no go struct is registered for the target GVK
This issue is found when working on #39906. This is a different issue from #39906. It affects all 1.5.x and master.
The error message is
kubectl applyandeditare broken for TPR in branch 1.5 and master.The reason is the function call of
Decode(). It fails to decode the data.Anything else do we need to know:
1.4.7 is working, but 1.4.8 is not, because of #39396.
Similar patch #38982 has been introduced in 1.5.2, but both 1.5.1 and 1.5.2 are broken for TPR.
applyfails without even reaching the code introduced in #38982.@liggitt @deads2k @pwittrock @kubernetes/sig-cli-misc
The text was updated successfully, but these errors were encountered: