Skip to content
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

Merged
merged 10 commits into from
Dec 13, 2022

Conversation

gongmax
Copy link
Collaborator

@gongmax gongmax commented Dec 9, 2022

…the allocation source

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug
/kind cleanup
/kind documentation

/kind feature

/kind hotfix

What this PR does / Why we need it:
Introduce the Source field in GameServerAllocationStatus and AllocationResponse to indicate the allocation source. If the allocation is from a remote cluster, the value of the Source 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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 82e2d831-ab7c-4cc5-9789-7663ef5b0074

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/googleforgames/agones.git pull/2860/head:pr_2860 && git checkout pr_2860
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.tag=1.29.0-9f4f050-amd64

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 8307d4e7-52f3-402b-8805-ac4c5bb3ab5e

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/googleforgames/agones.git pull/2860/head:pr_2860 && git checkout pr_2860
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.tag=1.29.0-e959de4-amd64

@gongmax gongmax marked this pull request as ready for review December 9, 2022 06:36
@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/googleforgames/agones.git pull/2860/head:pr_2860 && git checkout pr_2860
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.tag=1.29.0-ceef158-amd64

@markmandel
Copy link
Member

Just took a look at the preview website, and unfortunately this happened 😁

image

Looks like there's some malformed markdown in there that needs tweaking. Otherwise, this looks good to go.

@gongmax
Copy link
Collaborator Author

gongmax commented Dec 10, 2022

Fixed the markdown issue 😓
Lessons learned: run make site-server to verify before pushing any website change 😊

@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/googleforgames/agones.git pull/2860/head:pr_2860 && git checkout pr_2860
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.tag=1.29.0-d55e0ce-amd64

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 4caa5065-80e2-49f9-a4d5-650c9ba96912

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/googleforgames/agones.git pull/2860/head:pr_2860 && git checkout pr_2860
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.tag=1.29.0-a3e3c6e-amd64

@aimuz
Copy link
Collaborator

aimuz commented Dec 10, 2022

@markmandel

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

Copy link
Collaborator

@aimuz aimuz left a 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",
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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

Copy link
Collaborator Author

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.

@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/googleforgames/agones.git pull/2860/head:pr_2860 && git checkout pr_2860
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.tag=1.29.0-70b0131-amd64

@aimuz
Copy link
Collaborator

aimuz commented Dec 11, 2022

LGTM

@google-oss-prow google-oss-prow bot removed the lgtm label Dec 12, 2022
@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/googleforgames/agones.git pull/2860/head:pr_2860 && git checkout pr_2860
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.tag=1.29.0-7bfce84-amd64

@gongmax gongmax requested review from markmandel and zmerlynn and removed request for EricFortin, aLekSer and dzlier-gcp December 13, 2022 00:04
Copy link
Collaborator

@zmerlynn zmerlynn left a 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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@google-oss-prow google-oss-prow bot added the lgtm label Dec 13, 2022
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aimuz, gongmax, zmerlynn
Once this PR has been reviewed and has the lgtm label, please assign roberthbailey for approval by writing /assign @roberthbailey in a comment. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/googleforgames/agones.git pull/2860/head:pr_2860 && git checkout pr_2860
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.tag=1.29.0-a847f81-amd64

@gongmax gongmax merged commit 05da749 into googleforgames:main Dec 13, 2022
@gongmax gongmax deleted the fix_warning branch December 13, 2022 00:55
@Kalaiselvi84 Kalaiselvi84 added this to the 1.29.0 milestone Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid warnings when using multi-cluster allocation
6 participants