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

patching json document fails on 7.x+ #815

Closed
schmitch opened this issue Mar 31, 2022 · 3 comments
Closed

patching json document fails on 7.x+ #815

schmitch opened this issue Mar 31, 2022 · 3 comments

Comments

@schmitch
Copy link

var cronJobPatch = new JsonPatchDocument<V1CronJob>().Replace(e => e.Spec.Suspend, true);
var cronJobWithHttp =
        await client.PatchNamespacedCronJobAsync(new V1Patch(cronJobPatch, V1Patch.PatchType.JsonPatch),
            name, namespace);

this code will fail on dotnet 6 and k8s dotnet client 7.x+ this worked perfectly fine on 6.x+

@tg123
Copy link
Member

tg123 commented Mar 31, 2022

please see #772
newtonjson is replaced by system.text.json

@kibernetik542
Copy link
Contributor

var cronJobPatch = new JsonPatchDocument<V1CronJob>().Replace(e => e.Spec.Suspend, true);
var cronJobWithHttp =
        await client.PatchNamespacedCronJobAsync(new V1Patch(cronJobPatch, V1Patch.PatchType.JsonPatch),
            name, namespace);

this code will fail on dotnet 6 and k8s dotnet client 7.x+ this worked perfectly fine on 6.x+

I had also same issue please check it out my fix, I just made also PR for this issue

P.S. My example for csrApproval but you will get point of using new approach for new patch logic

@schmitch
Copy link
Author

schmitch commented Apr 4, 2022

thanks for your help, I will close my comment for now!

@schmitch schmitch closed this as completed Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants