-
Notifications
You must be signed in to change notification settings - Fork 810
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
handle static port policy #3375
Conversation
Build Failed 😱 Build Id: 210398ff-74c9-4c46-bd26-14cb76628cb3 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
30f247d
to
b39b031
Compare
Build Failed 😱 Build Id: 51c1b3db-d307-43c1-b22f-0b7883815d62 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 2467e168-0b47-4a41-bd48-428c9819bcee 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.
This looks like a good start!
Next step, let's create an e2e test for it! You can likely copy some existing examples for a lot of it - let me know if you would like me to point to some.
Sure! I will create e2e test for it. Correct me if I am wrong, I think you are talking about this existing examples https://github.com/googleforgames/agones/blob/main/test/e2e/framework/framework.go#L523. Am I on right track? |
Yes, but I'm talking about using something like: agones/test/e2e/gameserver_test.go Line 862 in 18163e8
And doing a version with a Static port. One thing to note - you will probably have to edit your firewall configurations to allow TCP connections to have the test pass for you locally (by default it was off). |
2a401f2
to
51e011c
Compare
Build Failed 😱 Build Id: 3ce028cc-782b-44bb-a384-5a1b14786ab8 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
51e011c
to
6616e5b
Compare
Build Failed 😱 Build Id: 37144c2b-5d74-4d97-a6f1-67ad36fc6323 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: ad612f98-c0c1-4082-bff3-000f5cba3f11 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
test/e2e/gameserver_test.go
Outdated
if err != nil { | ||
assert.FailNow(t, "Could not get a GameServer ready", err.Error()) | ||
} |
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.
Nit:
if err != nil { | |
assert.FailNow(t, "Could not get a GameServer ready", err.Error()) | |
} | |
require.NoError(t, err) |
Same for below.
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.
Bumping this final nit (and below), then this is good to merge.
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.
I think I accidentally resolved this yesterday when I didn't mean to.
if we can convert all the
if err != nil {
assert.FailNow(t, ...)
}
Statements into require.NoError(t, err)
that would be the last thing needed before this is good to merge.
Bringing offline conversation back to PR. I see why you are getting the error message for agones/test/e2e/framework/framework.go Lines 232 to 243 in 98bd2c5
For the Dynamic Port Allocation strategy, it actually edits the backing agones/pkg/portallocator/portallocator.go Lines 186 to 198 in cd85fa0
Whereas what we are doing with this implementation is returning the appropriate So we have two options:
The appropriate place does seem to be here: agones/pkg/gameservers/controller.go Lines 493 to 504 in cd85fa0
Before creating the Pod, and then when it Updates the GameServer those new port details will get updated along with them.
I'm leaning towards No. 1, since that brings this implementation inline with what the PortAllocator does, and lowers the number of testing paths we need to manage (and special cases in the tests) - but what are your thoughts? |
Yes, You are right! Rather than writing and handling number of test cases we should proceed with the case1.
However, I tried and added the above piece of code before Creating the pod here: agones/pkg/gameservers/controller.go Line 506 in cd85fa0
Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference) . And it is throwing the error after this log logrus.WithField("After", gs).Debug("Made Static PortPolicy changes") inside this function agones/pkg/gameservers/controller.go Line 506 in cd85fa0
|
Hard to debug without seeing the code 😃 so if you get really stuck, please upload the full log and the code. |
Bumping this comment: https://github.com/googleforgames/agones/pull/3375/files#r1379210777 as the only thing still required to get this PR completed. |
Build Succeeded 👏 Build Id: 5c43af7d-29db-46a8-b771-197bef652695 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:
|
7370aeb
to
c3bbdfa
Compare
Build Failed 😱 Build Id: c78e862a-38e2-4f3b-8fb2-e4ebc1d13548 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
I did the changes. But, Somehow build is failing at step-20. I am not getting why it's failing because it's not related to my code changes. Could you please look into this? |
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. #3505 should fix the flake I believe, so once that merges, this will go in next.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ashutosji, 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: fdf35c8f-58e3-4939-be0b-7c767fd2c322 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?
What this PR does / Why we need it: This PR is a fix for static portPolicy.
Which issue(s) this PR fixes: #2314
Closes #2314
Special notes for your reviewer: