-
Notifications
You must be signed in to change notification settings - Fork 825
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
Add labels and annotations to allocation response #3197
Add labels and annotations to allocation response #3197
Conversation
Build Failed 😱 Build Id: 8e006635-244e-4c48-b9e0-b6522e067006 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
linter failure
|
Build Failed 😱 Build Id: 1adb67bb-0a91-4f46-9fbe-956fbef0d01d To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
This reverts commit adb968d.
I removed the sdk generation and a change I had made to get that working for node js. Just as a heads up, it seems like that may have been broken since the last time someone made changes to the protobuf a few months ago. |
Build Failed 😱 Build Id: 83d79f82-28e7-46e3-b67d-aedb92ac0a81 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 569616a3-0c59-424a-932f-3ea2814a6fdb To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 2b15d7b9-0cfe-43e0-bb7e-c973c9f66a33 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): 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.
Thanks for doing all this work! Added a few questions inline.
Only other things I can think of to add:
- Updates to the documentation, at the very least the GameServerAllocation Specification
- Update to the example (which is basically the same as above) https://github.com/googleforgames/agones/blob/main/examples/gameserverallocation.yaml
- End to end tests , could probably extend what we already have, primarily:
func TestCreateFleetAndGameServerAllocate(t *testing.T) { |
and
agones/test/e2e/allocator_test.go
Line 151 in 9c33780
func TestAllocatorWithSelectors(t *testing.T) { |
Will suffice.
But really excited to have this in Agones!
@gongmax @zmerlynn - do we see any reason to put this behind a feature gate? I think it's likely fine, since I can't think of anything we'd want to change in this, but figured I would ask.
Since it's a new return from the API, I can't imagine needing a feature gate - rather, I think the question is whether it should be introduced straight to the |
I agreed. Previously we introduced the |
SGTM! in which case one we have some docs, examples and e2e tests, this should be good to merge 👍🏻 🤸🏻 |
Build Failed 😱 Build Id: 609091b9-9d7f-4996-8d0b-628d7a73f7a2 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 5efa7beb-70f5-42c3-abf9-5c6086613f73 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 7776b798-09ee-43fe-a956-e4381c0ed92f The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Assuming this build succeeds, this pr should be ready for another round of review |
Build Succeeded 👏 Build Id: f2d4b4f5-ab86-46ba-b7ad-e19a6eb4c24c The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): 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.
Looks good! Added some notes on some code cleanup.
One extra e2e test to add and I think we're good to go:
https://github.com/googleforgames/agones/blob/main/test/e2e/allocator_test.go
Just to e2e test the conversion to grpc and rest work as expected - you could even just add labels and annotations to the existing tests rather than spin up a whole new one if that's easier (also avoids waiting for the tls certs to refresh any more).
@@ -16,7 +16,7 @@ | |||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. | |||
// versions: | |||
// - protoc-gen-go-grpc v1.2.0 | |||
// - protoc v3.21.6 | |||
// - protoc v3.21.12 |
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.
🤔 wondering why this is here? (and in the other sdk files)
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.
That's a good question, and one I can't answer. I don't have a standalone install of protoc on my machine. Something I did notice is that some of the protobuf seems to have not been generated for some client libraries in some time(if you run it on main, it fails) so this may be an artifact of that?
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.
Ooh I see - this is an artifact of running the make gen-allocation-grpc
? (I would have thought it would have only happened for make gen-sdk-grpc
🤔 weird.
I mean it's a change in a comment - not the end of the world 🤷🏻 weird though.
Co-authored-by: Mark Mandel <markmandel@google.com>
Co-authored-by: Mark Mandel <markmandel@google.com>
Co-authored-by: Mark Mandel <markmandel@google.com>
Build Failed 😱 Build Id: a38915d6-ec0a-4bfc-807e-c4ad20279d94 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
…m/austin-space/agones into austin/add-labels-and-annotations
Build Succeeded 👏 Build Id: c04eb646-4e5c-4901-908e-bf50505f76fd The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): 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.
Looks good! Sorry about the delay in final approval!
@@ -208,6 +208,7 @@ func TestAllocatorWithSelectors(t *testing.T) { | |||
require.NoError(t, err) | |||
require.Equal(t, response.GameServerName, allocatedResponse.GameServerName) | |||
helper.ValidateAllocatorResponse(t, allocatedResponse) | |||
assert.Equal(t, flt.ObjectMeta.Name, allocatedResponse.Metadata.Labels[agonesv1.FleetNameLabel]) |
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.
Clever!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: austin-space, markmandel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
New changes are detected. LGTM label has been removed. |
Build Succeeded 👏 Build Id: 6881c65f-9871-4eb5-b2cf-d61750d52fd7 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: 5508d002-df3c-425b-9011-231d35c00f9e The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
What type of PR is this?
/kind feature
What this PR does / Why we need it:
This PR is not complete. It almost certainly needs more tests and I haven't touched the documentation. I'm mostly looking for a quick gut check to see if I'm missing anything glaring.
This PR returns the labels and annotations of an allocated game server at allocation time with the allocation response or Allocation CR status. This opens up a few very interesting scenarios:
Which issue(s) this PR fixes:
Closes #2396
Special notes for your reviewer:
I tried to break out the changes I've made thus far into two commits: the first being my changes, the second being the result of running the variousI undid most of the autogen stuff since the sdk autogen stuff appears to be broken(related to the counts and lists changes it seems).gen
make commands. Hopefully this makes this PR a little more readable.Also worth noting that I originally tried to put this behind a feature flag, but I don't think that actually makes much sense since the fields will be in the protobuf no matter whether we put something in there or not and it could potentially be confusing for users since there is no alpha allocation protobuf. If you want I can add the feature flag back.