From 569e010cd05273f77114ec6b9bf45fab11803e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Levilain?= Date: Sat, 24 Aug 2024 18:02:35 +0200 Subject: [PATCH] feat(shulker-crds): specify scale subresource for ProxyFleet and MinecraftServerFleet (#623) --- .../templates/crds/shulkermc.io_minecraftserverfleets.yaml | 3 +++ kube/helm/templates/crds/shulkermc.io_proxyfleets.yaml | 3 +++ packages/shulker-crds/src/v1alpha1/minecraft_server_fleet.rs | 1 + packages/shulker-crds/src/v1alpha1/proxy_fleet.rs | 1 + packages/shulker-utils/src/time.rs | 2 +- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/kube/helm/templates/crds/shulkermc.io_minecraftserverfleets.yaml b/kube/helm/templates/crds/shulkermc.io_minecraftserverfleets.yaml index f9532fc4..0c98a3fd 100644 --- a/kube/helm/templates/crds/shulkermc.io_minecraftserverfleets.yaml +++ b/kube/helm/templates/crds/shulkermc.io_minecraftserverfleets.yaml @@ -2409,4 +2409,7 @@ spec: served: true storage: true subresources: + scale: + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas status: {} diff --git a/kube/helm/templates/crds/shulkermc.io_proxyfleets.yaml b/kube/helm/templates/crds/shulkermc.io_proxyfleets.yaml index 82b7f86a..43a59bf6 100644 --- a/kube/helm/templates/crds/shulkermc.io_proxyfleets.yaml +++ b/kube/helm/templates/crds/shulkermc.io_proxyfleets.yaml @@ -2348,4 +2348,7 @@ spec: served: true storage: true subresources: + scale: + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas status: {} diff --git a/packages/shulker-crds/src/v1alpha1/minecraft_server_fleet.rs b/packages/shulker-crds/src/v1alpha1/minecraft_server_fleet.rs index b2526b79..5974fe08 100644 --- a/packages/shulker-crds/src/v1alpha1/minecraft_server_fleet.rs +++ b/packages/shulker-crds/src/v1alpha1/minecraft_server_fleet.rs @@ -17,6 +17,7 @@ use crate::{ version = "v1alpha1", namespaced, status = "MinecraftServerFleetStatus", + scale = r#"{"specReplicasPath": ".spec.replicas", "statusReplicasPath": ".status.replicas"}"#, printcolumn = r#"{"name": "Replicas", "type": "integer", "jsonPath": ".status.replicas"}, {"name": "Age", "type": "date", "jsonPath": ".metadata.creationTimestamp"}"# )] #[serde(rename_all = "camelCase")] diff --git a/packages/shulker-crds/src/v1alpha1/proxy_fleet.rs b/packages/shulker-crds/src/v1alpha1/proxy_fleet.rs index 4a40a948..ac952db9 100644 --- a/packages/shulker-crds/src/v1alpha1/proxy_fleet.rs +++ b/packages/shulker-crds/src/v1alpha1/proxy_fleet.rs @@ -21,6 +21,7 @@ use crate::{ version = "v1alpha1", namespaced, status = "ProxyFleetStatus", + scale = r#"{"specReplicasPath": ".spec.replicas", "statusReplicasPath": ".status.replicas"}"#, printcolumn = r#"{"name": "Replicas", "type": "integer", "jsonPath": ".status.replicas"}, {"name": "Age", "type": "date", "jsonPath": ".metadata.creationTimestamp"}"# )] #[serde(rename_all = "camelCase")] diff --git a/packages/shulker-utils/src/time.rs b/packages/shulker-utils/src/time.rs index 448ea39f..2d68140b 100644 --- a/packages/shulker-utils/src/time.rs +++ b/packages/shulker-utils/src/time.rs @@ -7,7 +7,7 @@ pub fn now() -> DateTime { #[cfg(feature = "testing")] thread_local! { - pub static UTC_TIME_SECONDS: std::sync::atomic::AtomicI64 = std::sync::atomic::AtomicI64::new(0); + pub static UTC_TIME_SECONDS: std::sync::atomic::AtomicI64 = const { std::sync::atomic::AtomicI64::new(0) }; } #[cfg(feature = "testing")]