Skip to content

Commit

Permalink
GameServer CRD with Updated Player Tracking (#1476)
Browse files Browse the repository at this point in the history
This updates the GameServer CRD based on the
[updated design](#1033 (comment))
for Player Tracking.
  • Loading branch information
markmandel committed Apr 17, 2020
1 parent 3d22c68 commit bcde5c5
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 93 deletions.
16 changes: 0 additions & 16 deletions install/helm/agones/templates/crds/_gameserverspecvalidation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,4 @@ properties:
type: integer
title: The initial player capacity of this Game Server
minimum: 0
webhook:
type: object
title: webhook to call when a player connects or disconnects
properties:
service:
properties:
name:
type: string
namespace:
type: string
path:
type: string
url:
type: string
caBundle:
type: string
{{- end }}
48 changes: 0 additions & 48 deletions install/yaml/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -406,22 +406,6 @@ spec:
type: integer
title: The initial player capacity of this Game Server
minimum: 0
webhook:
type: object
title: webhook to call when a player connects or disconnects
properties:
service:
properties:
name:
type: string
namespace:
type: string
path:
type: string
url:
type: string
caBundle:
type: string
subresources:
# status enables the status subresource.
status: {}
Expand Down Expand Up @@ -720,22 +704,6 @@ spec:
type: integer
title: The initial player capacity of this Game Server
minimum: 0
webhook:
type: object
title: webhook to call when a player connects or disconnects
properties:
service:
properties:
name:
type: string
namespace:
type: string
path:
type: string
url:
type: string
caBundle:
type: string

---
# Source: agones/templates/crds/gameserverallocationpolicy.yaml
Expand Down Expand Up @@ -1050,22 +1018,6 @@ spec:
type: integer
title: The initial player capacity of this Game Server
minimum: 0
webhook:
type: object
title: webhook to call when a player connects or disconnects
properties:
service:
properties:
name:
type: string
namespace:
type: string
path:
type: string
url:
type: string
caBundle:
type: string
subresources:
# status enables the status subresource.
status: {}
Expand Down
9 changes: 4 additions & 5 deletions pkg/apis/agones/v1/gameserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"agones.dev/agones/pkg/util/runtime"
"github.com/mattbaird/jsonpatch"
"github.com/pkg/errors"
admregv1b "k8s.io/api/admissionregistration/v1beta1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -160,8 +159,7 @@ type GameServerSpec struct {
// PlayersSpec tracks the initial player capacity, and what webhooks to send events to when there are
// connection/disconnection events.
type PlayersSpec struct {
InitialCapacity int64 `json:"initialCapacity,omitempty"`
Webhook *admregv1b.WebhookClientConfig `json:"webhook,omitempty"`
InitialCapacity int64 `json:"initialCapacity,omitempty"`
}

// GameServerState is the state for the GameServer
Expand Down Expand Up @@ -241,8 +239,9 @@ type GameServerStatusPort struct {

// PlayerStatus stores the current player capacity values
type PlayerStatus struct {
Count int64 `json:"count"`
Capacity int64 `json:"capacity"`
Count int64 `json:"count"`
Capacity int64 `json:"capacity"`
IDs []string `json:"IDs"`
}

// ApplyDefaults applies default values to the GameServer if they are not already populated
Expand Down
15 changes: 7 additions & 8 deletions pkg/apis/agones/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 28 additions & 16 deletions site/content/en/docs/Reference/agones_crd_api_reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
description="Detailed list of Agones Custom Resource Definitions available"
+++

{{% feature expiryVersion="1.5.0" %}}
{{% feature expiryVersion="1.6.0" %}}
<p>Packages:</p>
<ul>
<li>
Expand Down Expand Up @@ -611,13 +611,26 @@ <h3 id="GameServerPort">GameServerPort
</tr>
<tr>
<td>
<code>container</code></br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Container is the name of the container on which to open the port. Defaults to the game server container.
This field is alpha-level and is only honored by servers that enable the &ldquo;ContainerPortAllocation&rdquo; feature.</p>
</td>
</tr>
<tr>
<td>
<code>containerPort</code></br>
<em>
int32
</em>
</td>
<td>
<p>ContainerPort is the port that is being opened on the game server process</p>
<p>ContainerPort is the port that is being opened on the specified container&rsquo;s process</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -977,7 +990,8 @@ <h3 id="GameServerStatus">GameServerStatus
</td>
<td>
<em>(Optional)</em>
<p>(Alpha, PlayerTracking feature flag)</p>
<p>[Stage:Alpha]
[FeatureFlag:PlayerTesting]</p>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -2672,7 +2686,7 @@ <h3 id="GameServerAllocationPolicySpec">GameServerAllocationPolicySpec
Generated with <code>gen-crd-api-reference-docs</code>.
</em></p>
{{% /feature %}}
{{% feature publishVersion="1.5.0" %}}
{{% feature publishVersion="1.6.0" %}}
<p>Packages:</p>
<ul>
<li>
Expand Down Expand Up @@ -3945,6 +3959,16 @@ <h3 id="PlayerStatus">PlayerStatus
<td>
</td>
</tr>
<tr>
<td>
<code>IDs</code></br>
<em>
[]string
</em>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<h3 id="PlayersSpec">PlayersSpec
Expand Down Expand Up @@ -3975,18 +3999,6 @@ <h3 id="PlayersSpec">PlayersSpec
<td>
</td>
</tr>
<tr>
<td>
<code>webhook</code></br>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#webhookclientconfig-v1beta1-admissionregistration">
Kubernetes admissionregistration/v1beta1.WebhookClientConfig
</a>
</em>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<h3 id="PortPolicy">PortPolicy
Expand Down

0 comments on commit bcde5c5

Please sign in to comment.