From dadfb4d72ec00644467e457ab001050b4362fe42 Mon Sep 17 00:00:00 2001 From: Janis Date: Sat, 2 May 2026 20:41:01 +0200 Subject: [PATCH] fix(coordinator): use genericKubernetesResources API for Argo Rollout scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fabric8 disallows client.resources(classOf[GenericKubernetesResource]) — throws KubernetesClientException at runtime. Switch to genericKubernetesResources(apiVersion, kind) which is the correct API for CRDs. Co-Authored-By: Claude Haiku 4.5 --- .../scala/de/nowchess/coordinator/service/AutoScaler.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/coordinator/src/main/scala/de/nowchess/coordinator/service/AutoScaler.scala b/modules/coordinator/src/main/scala/de/nowchess/coordinator/service/AutoScaler.scala index 5a074c8..bc9dcfc 100644 --- a/modules/coordinator/src/main/scala/de/nowchess/coordinator/service/AutoScaler.scala +++ b/modules/coordinator/src/main/scala/de/nowchess/coordinator/service/AutoScaler.scala @@ -30,6 +30,9 @@ class AutoScaler: if kubeClientInstance.isUnsatisfied then None else Some(kubeClientInstance.get()) + private val argoApiVersion = "argoproj.io/v1alpha1" + private val argoKind = "Rollout" + // scalafix:off DisableSyntax.asInstanceOf // scalafix:off DisableSyntax.isInstanceOf private def rolloutSpec(rollout: GenericKubernetesResource): Option[java.util.Map[String, AnyRef]] = @@ -61,7 +64,7 @@ class AutoScaler: try Option( kube - .resources(classOf[GenericKubernetesResource]) + .genericKubernetesResources(argoApiVersion, argoKind) .inNamespace(config.k8sNamespace) .withName(config.k8sRolloutName) .get(), @@ -102,7 +105,7 @@ class AutoScaler: try Option( kube - .resources(classOf[GenericKubernetesResource]) + .genericKubernetesResources(argoApiVersion, argoKind) .inNamespace(config.k8sNamespace) .withName(config.k8sRolloutName) .get(),