-
Notifications
You must be signed in to change notification settings - Fork 40k
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 does not update ThirdPartyResource object. #29542
Comments
@ianlewis what's your kubernetes version? |
Here ya go. Didn't realize the client wasn't 1.3.3 yet. Client was pulled from https://storage.googleapis.com/kubernetes-release/release/v1.3.0/bin/darwin/amd64/kubectl
|
We just met the exact same issue. It does not work for current master either. @pwittrock Should this be considered as a bug? Why this is a p2 issue? |
@xiang90 Sounds like a bug. Re: the priority, it was a rough estimate. If you think things need a higher priority and attention, ping the thread and I will give it more attention. If you need this fixed immediately let me know and I will shuffle things around. |
@pwittrock Thank you! We can workaround this by using cURL. But it is not ideal. :) |
I plan to have this fixed in 1.5. Do you think that is sufficient? |
sure. thanks. |
@adohe Do you have time to look into this? |
ok, will fix this asap. |
@adohe Any updates? |
@ianlewis actually in the final patch, we have include the configuration change, something like below:
the reason why the |
@brendandburns could you please explain the |
@adohe The data field is basically arbitrary JSON that the user can specify per object. |
@adohe the data field is the arbitrary JSON representation of the third party object. We need to store the object as a |
@brendandburns that's the problem, when we apply a patch, we just update the |
@adohe are you working on this? If not I'll take it back over... |
There are a couple libraries in go to deal with the JSON-patch spec, here's one that can produce merge patches based on two arbitrary JSONs and also apply those patches: https://github.com/evanphx/json-patch |
@ConnorDoyle thanks for reference this, actually in kubernetes, we not only support standard JSON merge patch, but also support strategic merge patch, which is a custom implementation of merge patch. I have fixed this on my local, and will open a PR this weekend after I test it. |
@adohe Any updates on this one? or has this been punted to 1.6? |
@foxish yes, I think we can put this on 1.6, we are going to remove |
This is going to affect anyone using TPR (we develop etcd operator for example) pretty hard. This is a bug, and I feel we should fix this in 1.5. /cc @brendandburns |
@xiang90 I agree, but I don't think we have enough bandwidth to fix this properly in 1.5. |
@foxish I did the provided version "example.com/v1alpha1" has no relevant versions: group example.com has not been registered Could you tell us how to make this work? I use kubectl v1.5.0-beta.2 |
@tatsuhiro-t, see my comment here foxish/spark#3 (comment) |
@foxish thank you! |
@xiang90 what's the workaround with cURL? |
@hjacobs https://github.com/coreos/etcd-operator/blob/master/README.md#resize-an-etcd-cluster has an example of the workaround. |
Note that this issue is breaking Helm for TPRs; see helm/helm#1468. |
@adohe Are there any updates on the status of this issue? Would it help to have @ymqytw look into it as well? |
Isn't the core issue |
@liggitt Yeah, the struct is used for the tags determining how to merge list fields. Is it used for anything else? WDYT of simply choosing defaults for the values we would get from the structs for TPRs? e.g. always assume |
I wouldn't want to assume unknown types are TPRs, but having a default apply mode for types where we can't use the normal go struct logic (which could be TPRs or types from add-on API servers) makes sense to me. The same approach could work for fields of type Interface or runtime.RawExtension that currently don't support apply either |
c.f. #14998 |
fixed in #40666 |
kubernetes/kubernetes#29542 has been fixed, use apply instead of create to create third party resources in custom service monitoring example.
kubernetes/kubernetes#29542 has been fixed, use apply instead of create to create third party resources in custom service monitoring example.
I have a ThirdPartyResource object. The resource is as follows:
resource.yaml
crontab.yaml
I create the resource and object
However, when I run apply I fails to update the properties.
kubectl is sending a request to the API and if I watch the object I get a modified event but it is still the old value. Getting the object also returns the old value.
I suspect that kubectl is not diffing the object properly and neglects to send the updated object JSON data.
The text was updated successfully, but these errors were encountered: