-
Notifications
You must be signed in to change notification settings - Fork 826
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
Allocation is broken when using the generated go client #347
Conversation
Build Failed 😱 Build Id: 1e7b02c6-1597-43cb-81aa-83d9df5a1a34 Build Logs
|
91d7be5
to
eefaceb
Compare
Build Failed 😱 Build Id: a0671d4d-7c38-48dc-b3b7-54da0c39261c Build Logs
|
When attempting to create a fleet allocation through the generated go client the following error would occur: `"error: "Internal error occurred: Internal error occurred: jsonpatch replace operation does not apply: doc is missing key: /status/GameServer"` This is because we didn't mark pointers in `FleetAllocation` to be json, `omitempty`. When not using the client (either yaml, or rest) the following JSON is sent: ```json { "apiVersion": "stable.agones.dev/v1alpha1", "kind": "FleetAllocation", "metadata": { "generateName": "simple-udp-", "namespace": "default" }, "spec": { "fleetName": "simple-udp" } } ``` Previous to this fix, when calling through the go client, the following JSON would get generated: ```json { "apiVersion": "stable.agones.dev/v1alpha1", "kind": "FleetAllocation", "metadata": { "creationTimestamp": null, "generateName": "allocatioon-", "namespace": "default" }, "spec": { "fleetName": "simple-fleet-6fb7c", "metadata": {} }, "status": { "GameServer": null } } ``` That `nil` `GameServer` value messes up the library that creates the JSONPatch. Now we have the `omitempty` declarations in the correct places, this is working correctly. We also now have e2e tests to make sure the issue does not end up replicated. Need some user testing to determine if a hotfix is appropriate for this bug, or if a workaround can be applied/this library can be used without a need for a complete redeployment.
eefaceb
to
03f4866
Compare
Build Succeeded 👏 Build Id: 40394117-6446-4f59-b4b5-98938f04b663 The following development artifacts have been built, and will exist for the next 30 days:
(experimental) To install this version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This fix passed the following user test... To test this I downloaded agones-install-0.4.0.zip and then installed on gke by running
The call to test the fix looks like:
The result was the expected behaviour: One allocation was created, and there were no errors. |
When attempting to create a fleet allocation through the generated go client
the following error would occur:
"error: "Internal error occurred: Internal error occurred: jsonpatch replace operation does not apply: doc is missing key: /status/GameServer"
This is because we didn't mark pointers in
FleetAllocation
to be json,omitempty
.When not using the client (either yaml, or rest) the following JSON is sent (this works):
Previous to this fix, when calling through the go client, the following JSON would get generated (this doesn't work):
That
nil
GameServer
value messes up the library that creates the JSONPatch.Now we have the
omitempty
declarations in the correct places, this is working correctly. We also now have e2e tests to make sure the issue does not end up replicated.Need some user testing to determine if a hotfix is appropriate for this bug, or if a workaround can be applied/this library can be used without a need for a complete redeployment.