From b6ca11ee126908cdf07a26fb5dd874cbf0164978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de> Date: Mon, 14 Mar 2022 09:26:27 +0100 Subject: [PATCH] Improve code style --- .../benchmark/KubernetesBenchmark.kt | 2 +- .../operator/TheodoliteController.kt | 3 +-- .../k8s-resource-files/test-benchmark.yaml | 23 +++++++++++-------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt index cca573c6b..5aad784ea 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt @@ -62,7 +62,7 @@ class KubernetesBenchmark : KubernetesResource, Benchmark { this.infrastructure.beforeActions.forEach { it.exec(client = client) } val kubernetesManager = K8sManager(this.client) loadKubernetesResources(this.infrastructure.resources) - .map{it.second} + .map { it.second } // .forEach { client.resource(it).createOrReplace() } .forEach { kubernetesManager.deploy(it) } } diff --git a/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt b/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt index 5f4180b0b..d9cb33b18 100644 --- a/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt +++ b/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt @@ -130,8 +130,7 @@ class TheodoliteController( .list() .items .map { - it.spec.name = it.metadata.name - it + it.apply { it.spec.name = it.metadata.name } } } diff --git a/theodolite/src/test/resources/k8s-resource-files/test-benchmark.yaml b/theodolite/src/test/resources/k8s-resource-files/test-benchmark.yaml index 1ba204bb2..ea9ee8471 100644 --- a/theodolite/src/test/resources/k8s-resource-files/test-benchmark.yaml +++ b/theodolite/src/test/resources/k8s-resource-files/test-benchmark.yaml @@ -3,14 +3,19 @@ kind: benchmark metadata: name: example-benchmark spec: - appResource: - - "uc1-kstreams-deployment.yaml" - - "aggregation-service.yaml" - - "jmx-configmap.yaml" - - "uc1-service-monitor.yaml" - loadGenResource: - - "uc1-load-generator-deployment.yaml" - - "uc1-load-generator-service.yaml" + sut: + resources: + - configMap: + name: "example-configmap" + files: + - "uc1-kstreams-deployment.yaml" + loadGenerator: + resources: + - configMap: + name: "example-configmap" + files: + - uc1-load-generator-service.yaml + - uc1-load-generator-deployment.yaml resourceTypes: - typeName: "Instances" patchers: @@ -35,4 +40,4 @@ spec: numPartitions: 40 replicationFactor: 1 - name: "theodolite-.*" - removeOnly: True \ No newline at end of file + removeOnly: True -- GitLab