[Breaking Change] Multiple port support for GameServer#283
[Breaking Change] Multiple port support for GameServer#283markmandel merged 1 commit intoagones-dev:masterfrom
GameServer#283Conversation
|
Build Failed 😱 Build Id: 9cb52fe1-7640-4148-9ccd-c5c81fe9b309 Build Logs |
4327502 to
aefa4b1
Compare
|
Build Failed 😱 Build Id: bdf81aca-3cfc-4909-969b-f4f650e64290 Build Logs |
|
Build Succeeded 👏 Build Id: bf6159c2-4521-445b-ae4c-d1933abcfa22 The following development artifacts have been built, and will exist for the next 30 days:
|
| // we only want this to be called inside the mutex lock | ||
| // so let's define the function here so it can never be called elsewhere. | ||
| // Also the return gives an escape from the double loop | ||
| findOpenPorts := func(amount int) []pn { |
There was a problem hiding this comment.
@enocom would love to get your take on what I'm doing here.
There was a problem hiding this comment.
I've seen this pattern of declaring a function inside a method and then using it in the stdlib. It's something I've been meaning to do more often myself. Very nice.
| @@ -1,4 +1,4 @@ | |||
| # Copyright 2018 Google Inc. All Rights Reserved. | |||
| # Copyright 2017 Google Inc. All Rights Reserved. | |||
There was a problem hiding this comment.
Back in past, Marty !
There was a problem hiding this comment.
Whoops. Will change.
| HostPort int32 `json:"hostPort,omitempty"` | ||
| // Protocol is the network protocol being used. Defaults to UDP. TCP is the only other option | ||
| Protocol corev1.Protocol `json:"protocol,omitempty"` | ||
| // GameServerPort is deprecated, to be removed in 0.4.0: |
There was a problem hiding this comment.
all of this could be removed no ? We have docker images, chart artifacts, github releases..., I don't think it's necessary to carry this around until 0.4, what do you think ?
There was a problem hiding this comment.
When you say "all of this" - do you mean:
- drop the configuration backward compatibility for this release?
- Remove the comments on deprecation?
- Something else I'm not sure of?
There was a problem hiding this comment.
yes the two first point :)
There was a problem hiding this comment.
I was just being nice giving people a short opportunity to migrate -- technically we are in alpha, so we can make breaking changes if need be, but I know people are actively using Agones in a couple of places, so figured I would be more gradual about breaking things 😄 ?
Do you feel strongly that we should remove it?
There was a problem hiding this comment.
We had a chat - there was confusion around which release we were in. Looks like we're on the same page now, so merging this.
| // are to be exposed via the GameServer | ||
| type GameServerPort struct { | ||
| // Name is the descriptive name of the port | ||
| Name string `json:"name,omitempty"` |
There was a problem hiding this comment.
nice ! this looks familiar.
aefa4b1 to
2bd591a
Compare
|
Build Succeeded 👏 Build Id: 62325f2b-16e9-40a1-806f-d12fadd39fb9 The following development artifacts have been built, and will exist for the next 30 days:
|
This allows the `GameServer` (and anything that uses it as a template, such
as `Fleets`), to provide configuration and assignment of multiple ports to the
game server container.
For example:
```yaml
apiVersion: "stable.agones.dev/v1alpha1"
kind: GameServer
metadata:
name: "simple-udp"
spec:
ports:
- name: default
portPolicy: "dynamic"
containerPort: 7654
template:
spec:
containers:
- name: simple-udp
image: gcr.io/agones-images/udp-server:0.1
```
This also includes update to documentation - but in a separate bottom section
of each document, to allow for moving into the live version at release time.
(This is becoming a mess - a website can't come soon enough).
This also adjusts the `GameServer > Status`, to be able to handle multiple
ports. It now looks like this:
```
Status:
Address: 192.168.99.100
Node Name: agones
Ports:
Name: default
Port: 7502
State: Ready
```
While this a breaking change (due to the change in `GameServer > status`, the
previous legacy configuration of still works (even thought it's no longer
documented), as it is automatically converted to the new version.
Plans are to remove this legacy conversion functionality in 0.4.0, since being
in alpha, we have a very low commitment to backward compatibility.
As an aside - versioning for CRDs is coming soon, so this will also solve this
type of problem long term.
2bd591a to
f989694
Compare
|
Build Succeeded 👏 Build Id: dad947a4-ab3d-4c20-9e65-49fe8f4d8903 The following development artifacts have been built, and will exist for the next 30 days:
|
This allows the
GameServer(and anything that uses it as a template, such asFleets), to provide configuration and assignment of multiple ports to the game server container.For example:
This also includes update to documentation - but in a separate bottom section of each document, to allow for moving into the live version at release time. (This is becoming a mess - a website can't come soon enough).
This also adjusts the
GameServer > Status, to be able to handle multiple ports. It now looks like this:While this a breaking change (due to the change in
GameServer > status, the previous legacy configuration of still works (even thought it's no longer documented), as it is automatically converted to the new version.Plans are to remove this legacy conversion functionality in 0.4.0, since being in alpha, we have a very low commitment to backward compatibility.
As an aside - versioning for CRDs is coming soon, so this will also solve this type of problem long term.