Repository navigation
Allocation is broken when using the generated go client - #347
Merged
Merged
Conversation
Collaborator
|
Build Failed 😱 Build Id: 1e7b02c6-1597-43cb-81aa-83d9df5a1a34 Build Logs |
markmandel
force-pushed
the
e2e/fleets
branch
2 times, most recently
from
September 7, 2018 05:34
91d7be5 to
eefaceb
Compare
Collaborator
|
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.
markmandel
force-pushed
the
e2e/fleets
branch
from
September 7, 2018 05:41
eefaceb to
03f4866
Compare
Collaborator
|
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:
|
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
FleetAllocationto be json,omitempty.When not using the client (either yaml, or rest) the following JSON is sent (this works):
{ "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 (this doesn't work):
{ "apiVersion": "stable.agones.dev/v1alpha1", "kind": "FleetAllocation", "metadata": { "creationTimestamp": null, "generateName": "allocatioon-", "namespace": "default" }, "spec": { "fleetName": "simple-fleet-6fb7c", "metadata": {} }, "status": { "GameServer": null } }That
nilGameServervalue messes up the library that creates the JSONPatch.Now we have the
omitemptydeclarations 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.