diff --git a/theodolite/crd/crd-benchmark.yaml b/theodolite/crd/crd-benchmark.yaml index ed604816acec576e586c0bc4435578fac6a02894..57a144021d7948d788c3431af46fcdf24dac9e42 100644 --- a/theodolite/crd/crd-benchmark.yaml +++ b/theodolite/crd/crd-benchmark.yaml @@ -129,16 +129,16 @@ spec: items: type: object properties: - ConfigMapResourceSet: + configMap: type: object properties: - configmap: + name: type: string files: type: array items: type: string - FileSystemResourceSet: + fileSystem: type: object properties: path: @@ -152,16 +152,16 @@ spec: items: type: object properties: - ConfigMapResourceSet: + configMap: type: object properties: - configmap: + name: type: string files: type: array items: type: string - FileSystemResourceSet: + fileSystem: type: object properties: path: diff --git a/theodolite/examples/operator/example-benchmark.yaml b/theodolite/examples/operator/example-benchmark.yaml index f5e388fca1d4ae97ec64d99a5b8b81089e164b20..53d422c7cae3b9f389934080cf7241ba44d2737b 100644 --- a/theodolite/examples/operator/example-benchmark.yaml +++ b/theodolite/examples/operator/example-benchmark.yaml @@ -29,14 +29,14 @@ spec: - name: "theodolite-.*" removeOnly: True appResourceSets: - - FileSystemResourceSet: + - fileSystem: path: ./../../../../config files: - "uc1-kstreams-deployment.yaml" - "aggregation-service.yaml" - "jmx-configmap.yaml" - "uc1-service-monitor.yaml" - # - ConfigMapResourceSet: + # - configMap: # configmap: "test-configmap" # files: # - "uc1-kstreams-deployment.yaml" @@ -44,7 +44,7 @@ spec: # - "jmx-configmap.yaml" # - "uc1-service-monitor.yaml" loadGenResourceSets: - - FileSystemResourceSet: + - fileSystem: path: ./../../../../config files: - uc1-load-generator-service.yaml diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt b/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt index 20591f3b66b6fde4e564df6080117e7aefa3eaa9..723f81cf1e1b509b62bdc5933c36a5f5ecb2b8fc 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt @@ -10,6 +10,7 @@ import theodolite.k8s.resourceLoader.K8sResourceLoaderFromFile import theodolite.util.DeploymentFailedException import theodolite.util.YamlParserFromFile import java.io.File +import java.io.FileNotFoundException import java.lang.IllegalArgumentException private val logger = KotlinLogging.logger {} @@ -50,6 +51,9 @@ class FileSystemResourceSet: ResourceSet, KubernetesResource { kind = parser.parse(resourcePath, HashMap<String, String>()::class.java)?.get("kind")!! } catch (e: NullPointerException) { throw DeploymentFailedException("Can not get Kind from resource $resourcePath, error is ${e.message}") + } catch (e: FileNotFoundException){ + throw DeploymentFailedException("File $resourcePath not found") + } return try { diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt b/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt index 65de2b6390163808623bdee78867352c3e04f277..19c0808093f6729978f98940641031d8e425c349 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt @@ -13,10 +13,10 @@ import theodolite.util.DeploymentFailedException @RegisterForReflection @JsonInclude(JsonInclude.Include.NON_NULL) class ResourceSets: KubernetesResource { - @JsonProperty("ConfigMapResourceSet") + @JsonProperty("configMap") lateinit var configMap: ConfigMapResourceSet - @JsonProperty("FileSystemResourceSet") + @JsonProperty("fileSystem") lateinit var fileSystem: FileSystemResourceSet fun loadResourceSet(client: NamespacedKubernetesClient): Collection<Pair<String, KubernetesResource>> { diff --git a/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt b/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt index e7b5ed4293e52d767ae1247e200b8ba98208ca8e..8ead498a727a9ac6d88dab22cf99b0f2dd51e74a 100644 --- a/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt +++ b/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt @@ -65,7 +65,8 @@ class TheodoliteController( * @see BenchmarkExecution */ private fun runExecution(execution: BenchmarkExecution, benchmark: KubernetesBenchmark) { - val modifier = ConfigOverrideModifier( + try { + val modifier = ConfigOverrideModifier( execution = execution, resources = benchmark.loadKubernetesResources(benchmark.appResourceSets).map { it.first } + benchmark.loadKubernetesResources(benchmark.loadGenResourceSets).map { it.first } @@ -86,7 +87,6 @@ class TheodoliteController( executionStateHandler.setExecutionState(execution.name, States.RUNNING) executionStateHandler.startDurationStateTimer(execution.name) - try { executor = TheodoliteExecutor(execution, benchmark) executor.run() when (executionStateHandler.getExecutionState(execution.name)) { diff --git a/theodolite/src/test/kotlin/theodolite/benchmark/ConfigMapResourceSetTest.kt b/theodolite/src/test/kotlin/theodolite/benchmark/ConfigMapResourceSetTest.kt index f630d8d811a9291c9c5ca6ba48fd43c253c85098..8b9fa6e4e6cd1199fa39f7a8412f7ace7c7710f7 100644 --- a/theodolite/src/test/kotlin/theodolite/benchmark/ConfigMapResourceSetTest.kt +++ b/theodolite/src/test/kotlin/theodolite/benchmark/ConfigMapResourceSetTest.kt @@ -226,7 +226,6 @@ class ConfigMapResourceSetTest { try { resourceSet.getResourceSet(server.client) } catch (e: Exception) { - println( "haha " + e) ex = e } assertTrue(ex is DeploymentFailedException)