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

Upgrade Agones to 1.40.0 + CRD changes #945

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agones/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ IMAGE_TAG=us-docker.pkg.dev/my-project-name/dev/quilkin:0.4.0-auyz cargo test
### Build, Push and Test in one Go 💪

The [`build/Makefile`](../build/Makefile) provides a targets that can be executed to build a development image,
push it a appropriate location, and run the set of Agones integration tests, depending on where you Kubernetes
push it an appropriate location, and run the set of Agones integration tests, depending on where you Kubernetes
cluster is set up.

#### Minikube
Expand Down
6 changes: 3 additions & 3 deletions agones/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ variable "node_count" {

// Create a GKE cluster with the appropriate structure
module "agones_cluster" {
source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/gke/?ref=release-1.33.0"
source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/gke/?ref=release-1.40.0"

cluster = {
"name" = var.name
Expand All @@ -66,9 +66,9 @@ module "agones_cluster" {

// Install Agones via Helm
module "helm_agones" {
source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/helm3/?ref=release-1.33.0"
source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/helm3/?ref=release-1.40.0"

agones_version = "1.33.0"
agones_version = "1.40.0"
values_file = "./helm.yaml"
chart = "agones"
host = module.agones_cluster.host
Expand Down
4 changes: 2 additions & 2 deletions agones/src/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ mod tests {
for i in 0..30 {
println!("Connection Attempt: {i}");

// returns the nae of the GameServer. This proves we are routing the the allocated
// returns the name of the GameServer. This proves we are routing the allocated
// GameServer with the correct token attached.
socket
.send_to(format!("GAMESERVER{token}").as_bytes(), proxy_address)
Expand Down Expand Up @@ -164,7 +164,7 @@ mod tests {
.unwrap();
}

/// Deploys the Agent and Relay Server Deployents and Services
/// Deploys the Agent and Relay Server Deployments and Services
async fn agones_agent_deployment(client: &Client, deployments: Api<Deployment>) {
let service_accounts: Api<ServiceAccount> = client.namespaced_api();
let cluster_roles: Api<ClusterRole> = Api::all(client.kubernetes.clone());
Expand Down
2 changes: 1 addition & 1 deletion docs/src/deployment/quickstarts/agones-xonotic-relay.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Labels: agones.dev/fleet=xonotic
agones.dev/gameserverset=xonotic-8ns7b
Annotations: agones.dev/last-allocated: 2023-10-04T19:47:04.047026419Z
agones.dev/ready-container-id: containerd://b39d30965becdbc40336fd9aa642fe776421553615f642dd599e1b0d88c505b6
agones.dev/sdk-version: 1.33.0
agones.dev/sdk-version: 1.40.0
quilkin.dev/tokens: NDU2
API Version: agones.dev/v1
Kind: GameServer
Expand Down
2 changes: 1 addition & 1 deletion docs/src/deployment/quickstarts/agones-xonotic-xds.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Labels: agones.dev/fleet=xonotic
agones.dev/gameserverset=xonotic-h5cfn
Annotations: agones.dev/last-allocated: 2022-12-19T22:59:22.099818298Z
agones.dev/ready-container-id: containerd://7b3d9e9dbda6f2e0381df7669f6117bf3e54171469cfacbce2670605a61ce4b8
agones.dev/sdk-version: 1.33.0
agones.dev/sdk-version: 1.40.0
quilkin.dev/tokens: NDU2
API Version: agones.dev/v1
Kind: GameServer
Expand Down
13 changes: 11 additions & 2 deletions src/config/providers/k8s/agones.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,15 @@ impl kube::core::object::HasSpec for GameServer {
}
}

fn deserialize_null_default<'de, D, T>(deserializer: D) -> Result<T, D::Error>
where
T: Default + Deserialize<'de>,
D: serde::de::Deserializer<'de>,
{
let opt = Option::deserialize(deserializer)?;
Ok(opt.unwrap_or_default())
}

#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct GameServerSpec {
Expand All @@ -287,7 +296,7 @@ pub struct GameServerSpec {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub container: Option<String>,
/// Ports are the array of ports that can be exposed via the game server
#[serde(default)]
#[serde(deserialize_with = "deserialize_null_default")]
pub ports: Vec<GameServerPort>,
/// Configures health checking
pub health: Health,
Expand Down Expand Up @@ -388,7 +397,7 @@ pub struct GameServerStatus {
pub state: GameServerState,
pub ports: Option<Vec<GameServerStatusPort>>,
pub address: String,
#[serde(default)]
#[serde(deserialize_with = "deserialize_null_default")]
pub addresses: Vec<NodeAddress>,
pub node_name: String,
pub reserved_until: Option<k8s_openapi::apimachinery::pkg::apis::meta::v1::Time>,
Expand Down