-
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
Introduce the Source field in GameServerAllocationStatus to indicate the allocation source #2860
Conversation
…the allocation source
Build Failed 😱 Build Id: 82e2d831-ab7c-4cc5-9789-7663ef5b0074 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 0cf4e983-9839-4cea-988e-c5eaf22c1c9c 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 Failed 😱 Build Id: 8307d4e7-52f3-402b-8805-ac4c5bb3ab5e To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: c6f050b1-57c3-4b41-9207-7c8351ecb3a8 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: d498a4e3-3da6-4d91-a5a9-8ab8ba649aba 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:
|
Fixed the markdown issue 😓 |
Build Succeeded 👏 Build Id: 170821e1-1694-4a91-9813-d0699f14f3b5 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 Failed 😱 Build Id: 4caa5065-80e2-49f9-a4d5-650c9ba96912 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 7ec9e5a2-58be-4fea-9217-4405fa9fb817 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:
|
Can we add a CI check to avoid errors caused by not executing some compile commands after modifying the file? If you don't click on it manually to see it, then the problem may be hidden, if we have a CI check to check if the files are consistent it can expose some problem areas |
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.
Thank you
}, | ||
want: &allocationv1.GameServerAllocation{ | ||
TypeMeta: metav1.TypeMeta{ | ||
Kind: "GameServerAllocation", | ||
APIVersion: "allocation.agones.dev/v1", | ||
}, | ||
Status: allocationv1.GameServerAllocationStatus{ | ||
State: allocationv1.GameServerAllocationAllocated, | ||
State: allocationv1.GameServerAllocationAllocated, | ||
Source: "33.188.237.156:443", |
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.
If this is a real IP, it could leave you open to attack
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 the remind. It's a fake one.
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.
optional: https://datatracker.ietf.org/doc/html/rfc5737#section-3 if you want a test IP.
@@ -279,6 +279,9 @@ type GameServerAllocationStatus struct { | |||
Ports []agonesv1.GameServerStatusPort `json:"ports,omitempty"` | |||
Address string `json:"address,omitempty"` | |||
NodeName string `json:"nodeName,omitempty"` | |||
// If the allocation is from a remote cluster, Source is the endpoint of the remote agones-allocator. | |||
// Otherwise, Source is "local" | |||
Source string `json:"source"` //nolint:goimports |
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.
//nolint:goimports
What check is it to close?
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.
It complains the extra tab and spaces that were added by gofmt
to keep the alignment. The issue is that there are extra lines between line 281 and 284, and the linter seems not smart enough and thought those extra tabs and spaces in line 284 was violations.
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 we should use gofmt formatting, even though the formatting may not be ideal, but he can become a standard, and if other participants modify the problem subsequently, he will eventually become gofmt format, otherwise the participants need to control the aspect of the modification.
So I don't think we should have to force to align the format above.
Thanks
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.
Sounds fair. Also I found the old discussion around the issue. So gofmt
behaves as designed, though the behavior doesn't properly fit all the use cases.
Build Succeeded 👏 Build Id: b90cc9ea-a68d-4b3a-9bae-8912b010b626 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:
|
LGTM |
Build Succeeded 👏 Build Id: ef620a5f-ca71-4c66-b091-4f5142e2aba1 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.
LGTM
}, | ||
want: &allocationv1.GameServerAllocation{ | ||
TypeMeta: metav1.TypeMeta{ | ||
Kind: "GameServerAllocation", | ||
APIVersion: "allocation.agones.dev/v1", | ||
}, | ||
Status: allocationv1.GameServerAllocationStatus{ | ||
State: allocationv1.GameServerAllocationAllocated, | ||
State: allocationv1.GameServerAllocationAllocated, | ||
Source: "33.188.237.156:443", |
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.
optional: https://datatracker.ietf.org/doc/html/rfc5737#section-3 if you want a test IP.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aimuz, gongmax, zmerlynn The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Build Succeeded 👏 Build Id: 98931481-1ab5-41c9-b001-c8b8f02b52cb 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:
|
…the allocation source
What type of PR is this?
/kind feature
What this PR does / Why we need it:
Introduce the
Source
field inGameServerAllocationStatus
andAllocationResponse
to indicate the allocation source. If the allocation is from a remote cluster, the value of theSource
field will be the corresponding remote allocation endpoint.This filed is used by the
metrics.SetResponse
method so it can skip the look up of the allocated game server in the local cluster in the case that the allocation is from remote cluster.Which issue(s) this PR fixes:
Closes #2498
Special notes for your reviewer:
I accidentally closed #2799 and discarded all the commits when I tried to resolve merge conflict. This PR is identical as that one, with some documentation change which address the comments on the previous PR