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
Regression in kubectl apply for TPR's in v1.4.8 #39906
Comments
|
That patch is already in 1.4, 1.5 and master branch. We need a fix for all 3 branch. |
|
Sample case to reproduce the issue pkidef.json: pkiobj.json: |
|
@GnawNom Thanks for your sample. I'm working on it. |
|
@liggitt Created a PR #40096 to fix this issue in 1.4. But in branch 1.5 and master, apply breaks without reaching the code introduced in #38982. So #40096 is not enough to fix it. |
|
/cc @aaronlevy because of kubectl edit TPR failures we've seen before. |
|
@pires, |
|
@luxas I can fix this but your guidance is much appreciated. |
the correct fix is... invasive. kubectl 1.4.7 was not applying patches to third party resources correctly at all. if you look at the wire transfer (--v=8) of applying the above example with kubectl 1.4.7, you can see that it is actually sending a patch of a that's concerning for multiple reasons:
in kubectl 1.4.8, a fix was made to the way patches were computed to do so using the versioned struct. that exposed the fact that third party resource data patching was being done incorrectly. the correct fix would be:
both of those changes are large, complex, and not something I'd recommend picking into 1.4 (or probably 1.5) given that TPRs were not patching correctly even in 1.4.7, my recommendation would be to use |
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
|
apply has been updated to work with third party resources in 1.6 in #40666 |
BUG REPORT
Kubernetes version (use
kubectl version): v1.4.8Environment:
uname -a):Linux compute-master1001.ve.box.net 3.10.0-229.14.1.el7.x86_64 #1 SMP Tue Sep 15 05:09:55 CDT 2015 x86_64 x86_64 x86_64 GNU/LinuxWhat happened:
In kube v1.4.7 multiple invocations of
kubectl apply -f instanceOfThirdPartyResource.yamlwould succeed in v1.4.8 we get the error:What you expected to happen:
Would expect it to succeed. (Though maybe not actually apply changes).
How to reproduce it (as minimally and precisely as possible):
Make a thirdpartyresource make an instance of it. And apply that multiple times on 1.4.8. Sorry I can't share our manifests. I'll try to get another person at Box to produce a test case.
Anything else do we need to know:
We believe the regression was introduced in:
261cdcc
@pwittrock @ymqytw @ahakanbaba
The text was updated successfully, but these errors were encountered: