From 4cc51ca2624e57a736c5ac25bb6c8f4efba75f7b Mon Sep 17 00:00:00 2001 From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de> Date: Tue, 23 Mar 2021 13:05:06 +0100 Subject: [PATCH] fix empty list bug --- .../src/main/kotlin/theodolite/benchmark/Benchmark.kt | 2 +- .../main/kotlin/theodolite/benchmark/BenchmarkExecution.kt | 2 +- .../main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/Benchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/Benchmark.kt index 8c15fa1dc..fb343a0fa 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/Benchmark.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/Benchmark.kt @@ -8,6 +8,6 @@ interface Benchmark { fun buildDeployment( load: LoadDimension, res: Resource, - configurationOverrides: List<ConfigurationOverride> + configurationOverrides: List<ConfigurationOverride?> ): BenchmarkDeployment } diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt index 25535e1a6..5e640bf0e 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt @@ -10,7 +10,7 @@ class BenchmarkExecution { lateinit var resources: ResourceDefinition lateinit var slos: List<Slo> lateinit var execution: Execution - lateinit var configOverrides: List<ConfigurationOverride> + lateinit var configOverrides: List<ConfigurationOverride?> class Execution { lateinit var strategy: String diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt index 0110e1d7c..4091325bd 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt @@ -40,7 +40,7 @@ class KubernetesBenchmark : Benchmark { override fun buildDeployment( load: LoadDimension, res: Resource, - configurationOverrides: List<ConfigurationOverride> + configurationOverrides: List<ConfigurationOverride?> ): BenchmarkDeployment { val resources = loadKubernetesResources(this.appResource + this.loadGenResource) val patcherFactory = PatcherFactory() @@ -50,7 +50,7 @@ class KubernetesBenchmark : Benchmark { res.getType().forEach{ patcherDefinition -> patcherFactory.createPatcher(patcherDefinition, resources).patch(res.get().toString()) } // Patch the given overrides - configurationOverrides.forEach { override -> patcherFactory.createPatcher(override.patcher, resources).patch(override.value) } + configurationOverrides.forEach { override -> override?.let { patcherFactory.createPatcher(it.patcher, resources).patch(override.value) } } return KubernetesBenchmarkDeployment( -- GitLab