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

Incorrect patch generated with jsonpatch #281

Closed
com6056 opened this issue Jan 7, 2019 · 3 comments · Fixed by #289
Closed

Incorrect patch generated with jsonpatch #281

com6056 opened this issue Jan 7, 2019 · 3 comments · Fixed by #289
Assignees

Comments

@com6056
Copy link

com6056 commented Jan 7, 2019

I am encountering an issue when trying to inject things into pods with more than 1 container.

The ReplicaSet returns Error creating: Internal error occurred: Internal error occurred: Unable to remove invalid index: 1. I've narrowed it down to an issue with jsonpatch.

The issue is outlined here: mattbaird/jsonpatch#7
This fork has the fixes: https://github.com/appscode/jsonpatch

As a note, in the fork JsonPatchOperation is now just Operation.

@mengqiy
Copy link
Member

mengqiy commented Jan 7, 2019

Thanks for pointing this out!
We are considering switching to appscode/jsonpatch.

As a note, in the fork JsonPatchOperation is now just Operation.

This is a breaking change. We probably will switch to appscode/jsonpatch in v0.2.0 if we plan to introduce it as is.

@mengqiy mengqiy self-assigned this Jan 7, 2019
@rajathagasthya
Copy link
Contributor

@mengqiy (tangential) Just curious why https://github.com/evanphx/json-patch isn't used here. It's used in k/k.

@mengqiy
Copy link
Member

mengqiy commented Jan 8, 2019

@rajathagasthya https://github.com/evanphx/json-patch supports json patch (only applying patch) and json merge patch (generating and applying patch); while mattbaird/jsonpatch supports json patch (generating and applying patch)

Generating means: given 2 json objects and return the patch in byte array format.
Applying means: given a patch in byte array format, applying the changes to a json object.

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

Successfully merging a pull request may close this issue.

3 participants