diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherManager.kt b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherManager.kt index 5557eb4b98d5da3bbc8b8d82227de29335c5da67..a0e21b99894a82a3d428167ff1e763b3f078ea68 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherManager.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherManager.kt @@ -25,6 +25,7 @@ class PatcherManager { patcherDefinition.container, patcherDefinition.variableName ) + "SchedulerNamePatcher" -> SchedulerNamePatcher(resource) else -> throw IllegalArgumentException("Patcher type ${patcherDefinition.type} not found") } } diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/SchedulerNamePatcher.kt b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/SchedulerNamePatcher.kt new file mode 100644 index 0000000000000000000000000000000000000000..88d9a978f23c8c5612d2ad46df795b7e3ba8cd19 --- /dev/null +++ b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/SchedulerNamePatcher.kt @@ -0,0 +1,12 @@ +package theodolite.patcher + +import io.fabric8.kubernetes.api.model.KubernetesResource +import io.fabric8.kubernetes.api.model.apps.Deployment + +class SchedulerNamePatcher(private val k8sResource: KubernetesResource): Patcher { + override fun <String> patch(value: String) { + if (k8sResource is Deployment) { + k8sResource.spec.template.spec.schedulerName = value as kotlin.String; + } + } +} \ No newline at end of file