-
Notifications
You must be signed in to change notification settings - Fork 3k
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
dynamic/fake not honoring the patch type -> json doc error #478
Comments
yes, that's a bug. the patch type should definitely be included in the fake patch action, and the |
I can take a look at implementing this. |
Thanks. @p0lyn0mial you've been in the dynamic client. Are you up for a review? |
FYI, I was struggling a bit getting docker set up so I could run the hack update deps, but there are still breakages, but just curious about the general direction while I work on the breakages. |
yes :) |
So, it seems like just running the hack script as per here is not enough: Trying to figure out what else needs to change... "Saving deps in staging repos ./hack/update-staging-godeps.sh |
Having a hard time unit testing a Patch operation using a dynamic fake. If I run the code against a real cluster (using the dynamic client, not fake), things work aok, but in unit tests when trying to create a JSONPatch operation it fails always with "invalid JSON document".
It seems to be coming from pkg/util/strategicpatch/patch.go
Looks to me like our use of JSON Patch is not being honored since the patch type is not being used anywhere, and seems like instead it's trying to unserialized into a map[string]interface{} and it fails since JSON patch is an array of patch operations.
https://github.com/kubernetes/client-go/blob/master/dynamic/fake/simple.go#L334
Or, am I holding it somehow wrong and this is supposed to work?
Thanks in advance!
The text was updated successfully, but these errors were encountered: