diff --git a/helm/templates/theodolite/crd-benchmark.yaml b/helm/templates/theodolite/crd-benchmark.yaml index 084480e1f9e2ef827fb145cd823bbd2f68a20bac..455b9b7c05f22a9a08222765d95c451aa9cfece4 100644 --- a/helm/templates/theodolite/crd-benchmark.yaml +++ b/helm/templates/theodolite/crd-benchmark.yaml @@ -21,94 +21,160 @@ spec: properties: spec: type: object - required: [] + required: ["appResourceSets", "loadGenResourceSets", "resourceTypes", "loadTypes", "kafkaConfig"] properties: name: + description: This field exists only for technical reasons and should not be set by the user. The value of the field will be overwritten. type: string - appResource: - type: array - minItems: 1 - items: - type: string - loadGenResource: - type: array - minItems: 1 - items: - type: string resourceTypes: + description: A list of resource types that can be scaled for this `benchmark` resource. For each resource type the concrete values are defined in the `execution` object. type: array minItems: 1 items: type: object + required: ["typeName", "patchers"] properties: typeName: + description: Name of the resource type. type: string patchers: + description: List of patchers used to scale this resource type. + examples: test test test type: array minItems: 1 items: type: object + required: ["type", "resource"] properties: type: + description: Type of the patcher. type: string default: "" resource: + description: Specifies the Kubernetes resource to be patched. type: string default: "" properties: + description: (Optional) Patcher specific additional arguments. type: object additionalProperties: true x-kubernetes-map-type: "granular" default: {} loadTypes: + description: A list of load types that can be scaled for this benchmark. For each load type the concrete values are defined in the execution object. type: array minItems: 1 items: type: object + required: ["typeName","patchers"] properties: typeName: + description: Name of the load type. type: string patchers: + description: List of patchers used to scale this resource type. type: array minItems: 1 items: type: object + required: ["type", "resource"] properties: type: + description: Type of the Patcher. type: string default: "" resource: + description: Specifies the Kubernetes resource to be patched. type: string default: "" properties: + description: (Optional) Patcher specific additional arguments. type: object additionalProperties: true x-kubernetes-map-type: "granular" default: {} kafkaConfig: + description: Contains the Kafka configuration. type: object + required: ["bootstrapServer", "topics"] properties: bootstrapServer: + description: The bootstrap servers connection string. type: string topics: + description: List of topics to be created for each experiment. Alternative theodolite offers the possibility to remove certain topics after each experiment. type: array minItems: 1 items: type: object - required: [] + required: ["name"] properties: name: + description: The name of the topic. type: string default: "" numPartitions: + description: The number of partitions of the topic. type: integer default: 0 replicationFactor: + description: The replication factor of the topic. type: integer default: 0 removeOnly: + description: Determines if this topic should only be deleted after each experiement. For removeOnly topics the name can be a RegEx describing the topic. type: boolean default: false + appResourceSets: + type: array + items: + type: object + properties: + name: + type: string + ConfigMapResourceSet: + type: object + properties: + configmap: + type: string + files: + type: array + items: + type: string + FileSystemResourceSet: + type: object + properties: + path: + type: string + files: + type: array + items: + type: string + loadGenResourceSets: + type: array + items: + type: object + properties: + name: + type: string + ConfigMapResourceSet: + type: object + properties: + configmap: + type: string + files: + type: array + items: + type: string + FileSystemResourceSet: + type: object + properties: + path: + type: string + files: + type: array + items: + type: string additionalPrinterColumns: - name: Age type: date diff --git a/theodolite/crd/crd-benchmark.yaml b/theodolite/crd/crd-benchmark.yaml index 9cbd88e730623460bedf65724b8380280c912941..55c11a2004ef282152ceabb3058e6f18dca4258d 100644 --- a/theodolite/crd/crd-benchmark.yaml +++ b/theodolite/crd/crd-benchmark.yaml @@ -20,23 +20,11 @@ spec: properties: spec: type: object - required: ["appResource", "loadGenResource", "resourceTypes", "loadTypes", "kafkaConfig"] + required: ["appResourceSets", "loadGenResourceSets", "resourceTypes", "loadTypes", "kafkaConfig"] properties: name: description: This field exists only for technical reasons and should not be set by the user. The value of the field will be overwritten. type: string - appResource: - description: A list of file names that reference Kubernetes resources that are deployed on the cluster for the system under test (SUT). - type: array - minItems: 1 - items: - type: string - loadGenResource: - description: A list of file names that reference Kubernetes resources that are deployed on the cluster for the load generator. - type: array - minItems: 1 - items: - type: string resourceTypes: description: A list of resource types that can be scaled for this `benchmark` resource. For each resource type the concrete values are defined in the `execution` object. type: array @@ -118,7 +106,7 @@ spec: minItems: 1 items: type: object - required: ["name", "numPartitions", "replicationFactor"] + required: ["name"] properties: name: description: The name of the topic. @@ -148,11 +136,19 @@ spec: properties: configmap: type: string + files: + type: array + items: + type: string FileSystemResourceSet: type: object properties: path: type: string + files: + type: array + items: + type: string loadGenResourceSets: type: array items: @@ -165,11 +161,19 @@ spec: properties: configmap: type: string + files: + type: array + items: + type: string FileSystemResourceSet: type: object properties: path: type: string + files: + type: array + items: + type: string additionalPrinterColumns: - name: Age type: date diff --git a/theodolite/examples/operator/example-benchmark.yaml b/theodolite/examples/operator/example-benchmark.yaml index 1a2d406553fd30e2ba4085bca32cbd2cf79766f3..71bcba77894421ed31def9831663bbac68aa6ac9 100644 --- a/theodolite/examples/operator/example-benchmark.yaml +++ b/theodolite/examples/operator/example-benchmark.yaml @@ -3,14 +3,6 @@ kind: benchmark metadata: name: uc1-kstreams 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" resourceTypes: - typeName: "Instances" patchers: @@ -42,8 +34,16 @@ spec: - name: TestAppResources FileSystemResourceSet: path: ./config + files: + - "uc1-kstreams-deployment.yaml" + - "aggregation-service.yaml" + - "jmx-configmap.yaml" + - "uc1-service-monitor.yaml" loadGenResourceSets: - name: RestGenResources ConfigMapResourceSet: configmap: "test-configmap" + files: + - uc1-load-generator-service.yaml + - uc1-load-generator-deployment.yaml \ No newline at end of file diff --git a/theodolite/examples/operator/example-execution.yaml b/theodolite/examples/operator/example-execution.yaml index 5386fd7c8665e01302067da81c5dd4caf87fc602..48452dee509aa57b36d4d76a8c4646996630a5c2 100644 --- a/theodolite/examples/operator/example-execution.yaml +++ b/theodolite/examples/operator/example-execution.yaml @@ -24,7 +24,7 @@ spec: loadGenerationDelay: 30 # in seconds restrictions: - "LowerBound" - configOverrides: + configOverrides: [] # - patcher: # type: "NodeSelectorPatcher" # resource: "uc1-load-generator-deployment.yaml" diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/ConfigMapResourceSet.kt b/theodolite/src/main/kotlin/theodolite/benchmark/ConfigMapResourceSet.kt index f539ce0231dfaf6d1d6ef30bd864cd32a3ea2cfc..3bfad3ccd928879d3d86458fd91194cd36daeef7 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/ConfigMapResourceSet.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/ConfigMapResourceSet.kt @@ -9,56 +9,51 @@ import theodolite.k8s.resourceLoader.K8sResourceLoaderFromString import theodolite.util.YamlParserFromString private val logger = KotlinLogging.logger {} - - +private const val DEFAULT_NAMESPACE = "default" @JsonDeserialize class ConfigMapResourceSet: ResourceSet { lateinit var configmap: String lateinit var files: List<String> // load all files, iff files is not set - private val namespace = "default" - private val client: NamespacedKubernetesClient = DefaultKubernetesClient().inNamespace(namespace) // TODO(load namespace from env var) + private val namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE + private val client: NamespacedKubernetesClient = DefaultKubernetesClient().inNamespace(namespace) private val loader = K8sResourceLoaderFromString(client) @OptIn(ExperimentalStdlibApi::class) override fun getResourceSet(): List<Pair<String, KubernetesResource>> { - logger.info { "Load benchmark resources from configmap with name $configmap" } var resources = client .configMaps() .withName(configmap) .get() .data + .filter { it.key.endsWith(".yaml") } // consider only yaml files, e.g. ignore readme files if (::files.isInitialized){ resources = resources - .filterKeys { files.contains(it) } + .filter { files.contains(it.key) } } return resources .map { Pair( getKind(resource = it.value), - resources) } - .map { Pair( + it) } + .map { + Pair( it.first, - loader.loadK8sResource(it.first, it.second.values.first())) } + loader.loadK8sResource(it.first, it.second.value)) } } private fun getKind(resource: String): String { - logger.info { "1" } val parser = YamlParserFromString() - val resoureceAsMap = parser.parse(resource, HashMap<String, String>()::class.java) - logger.info { "2" } + val resourceAsMap = parser.parse(resource, HashMap<String, String>()::class.java) return try { - val kind = resoureceAsMap?.get("kind")!! - logger.info { "Kind is $kind" } - kind - + resourceAsMap?.get("kind")!! } catch (e: Exception) { - logger.error { "Could not find field kind of Kubernetes resource: ${resoureceAsMap?.get("name")}" } + logger.error { "Could not find field kind of Kubernetes resource: ${resourceAsMap?.get("name")}" } "" } } diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt b/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt index c6ae3026d81c7a4ec57af26e6c35aeaed931d94e..6866fcf8a07668d28ca7b0a59848817012d1dd00 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/FileSystemResourceSet.kt @@ -10,18 +10,17 @@ import theodolite.util.YamlParserFromFile import java.io.File private val logger = KotlinLogging.logger {} - +private const val DEFAULT_NAMESPACE = "default" @JsonDeserialize class FileSystemResourceSet: ResourceSet { lateinit var path: String lateinit var files: List<String> private val parser = YamlParserFromFile() - private val loader = K8sResourceLoaderFromFile(DefaultKubernetesClient().inNamespace("default")) // TODO(set namespace correctly) + private val namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE + private val loader = K8sResourceLoaderFromFile(DefaultKubernetesClient().inNamespace(namespace)) override fun getResourceSet(): List<Pair<String, KubernetesResource>> { - logger.info { "Get fileSystem resource set $path" } - //if files is set ... if(::files.isInitialized){ @@ -33,6 +32,7 @@ class FileSystemResourceSet: ResourceSet { return try { File(path) .list() !! + .filter { it.endsWith(".yaml") } // consider only yaml files, e.g. ignore readme files .map { loadSingleResource(it) } diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt index 049de2a9036a4012f57cad9245160c5056e07e2a..3151aca295d2d9bed9c9b24750090f4c433739b1 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt @@ -34,8 +34,8 @@ private var DEFAULT_NAMESPACE = "default" @RegisterForReflection class KubernetesBenchmark: KubernetesResource, Benchmark{ lateinit var name: String - lateinit var appResource: List<String> - lateinit var loadGenResource: List<String> + // var appResource: List<Pair<String, KubernetesResource>> + // var loadGenResource: List<Pair<String, KubernetesResource>> lateinit var resourceTypes: List<TypeName> lateinit var loadTypes: List<TypeName> lateinit var kafkaConfig: KafkaConfig @@ -44,6 +44,10 @@ class KubernetesBenchmark: KubernetesResource, Benchmark{ var namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE var path = System.getenv("THEODOLITE_APP_RESOURCES") ?: "./config" + // init { + // this.appResource = appResourceSets.flatMap { it.loadResourceSet() } + // this.loadGenResource = loadGenResourceSets.flatMap { it.loadResourceSet() } + // } /** * Loads [KubernetesResource]s. diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt b/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt index b8cd3a30e9ac8c8811a881c88552e617cadeb0db..b3ecf49c097af742faa9ad5574b1f9c96f630542 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt @@ -8,8 +8,6 @@ import io.quarkus.runtime.annotations.RegisterForReflection import mu.KotlinLogging import theodolite.util.DeploymentFailedException -private val logger = KotlinLogging.logger {} - @JsonDeserialize @RegisterForReflection @JsonInclude(JsonInclude.Include.NON_NULL) @@ -25,7 +23,6 @@ class ResourceSets: KubernetesResource { val FileSystemResourceSet: FileSystemResourceSet? = null fun loadResourceSet(): List<Pair<String, KubernetesResource>> { - logger.info { "LOAD" } return try { if (ConfigMapResourceSet != null) { ConfigMapResourceSet.getResourceSet() diff --git a/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt b/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt index 6bcff9aeed2e756f115f27fbf25cc2aa35230d2d..3a556b44fd8f9e7ed14298a0094e44fbf11dde3e 100644 --- a/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt +++ b/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt @@ -28,6 +28,7 @@ class TheodoliteController( private val executionStateHandler: ExecutionStateHandler ) { lateinit var executor: TheodoliteExecutor + /** * * Runs the TheodoliteController forever. @@ -63,15 +64,18 @@ class TheodoliteController( private fun runExecution(execution: BenchmarkExecution, benchmark: KubernetesBenchmark) { setAdditionalLabels(execution.name, "deployed-for-execution", - benchmark.appResource + benchmark.loadGenResource, + benchmark.appResourceSets.flatMap { it -> it.loadResourceSet().map { it.first } } + + benchmark.loadGenResourceSets.flatMap { it -> it.loadResourceSet().map { it.first } }, execution) setAdditionalLabels(benchmark.name, "deployed-for-benchmark", - benchmark.appResource + benchmark.loadGenResource, + benchmark.appResourceSets.flatMap { it -> it.loadResourceSet().map { it.first } } + + benchmark.loadGenResourceSets.flatMap { it -> it.loadResourceSet().map { it.first } }, execution) setAdditionalLabels("theodolite", "app.kubernetes.io/created-by", - benchmark.appResource + benchmark.loadGenResource, + benchmark.appResourceSets.flatMap { it -> it.loadResourceSet().map { it.first } } + + benchmark.loadGenResourceSets.flatMap { it -> it.loadResourceSet().map { it.first } }, execution) executionStateHandler.setExecutionState(execution.name, States.RUNNING) diff --git a/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sAbstractLoader.kt b/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sAbstractLoader.kt index 09cee6953b51a97a330819643b21a6332492ecdf..bfd183ae1d9fa999bb0c269ffb5daaf99e58dd5d 100644 --- a/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sAbstractLoader.kt +++ b/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sAbstractLoader.kt @@ -9,7 +9,7 @@ private val logger = KotlinLogging.logger {} abstract class AbstractK8sLoader: K8sResourceLoader { - abstract fun loadCustomResourceWrapper(path: String, context: CustomResourceDefinitionContext): KubernetesResource + abstract fun loadCustomResourceWrapper(resource: String, context: CustomResourceDefinitionContext): KubernetesResource fun loadK8sResource(kind: String, resourceString: String): KubernetesResource { return when (kind) { @@ -45,33 +45,33 @@ abstract class AbstractK8sLoader: K8sResourceLoader { - override fun loadServiceMonitor(path: String): KubernetesResource { + override fun loadServiceMonitor(resource: String): KubernetesResource { val context = K8sContextFactory().create( api = "v1", scope = "Namespaced", group = "monitoring.coreos.com", plural = "servicemonitors" ) - return loadCustomResourceWrapper(path, context) + return loadCustomResourceWrapper(resource, context) } - override fun loadExecution(path: String): KubernetesResource { + override fun loadExecution(resource: String): KubernetesResource { val context = K8sContextFactory().create( api = "v1", scope = "Namespaced", group = "theodolite.com", plural = "executions" ) - return loadCustomResourceWrapper(path, context) + return loadCustomResourceWrapper(resource, context) } - override fun loadBenchmark(path: String): KubernetesResource { + override fun loadBenchmark(resource: String): KubernetesResource { val context = K8sContextFactory().create( api = "v1", scope = "Namespaced", group = "theodolite.com", plural = "benchmarks" ) - return loadCustomResourceWrapper(path, context) + return loadCustomResourceWrapper(resource, context) } } \ No newline at end of file diff --git a/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sResourceLoaderFromFile.kt b/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sResourceLoaderFromFile.kt index a970ea4ef04dcc1ba9b77d96ee71c627389e0e11..08f34e1d67c9821c9f9a07a49f4ba8683a072611 100644 --- a/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sResourceLoaderFromFile.kt +++ b/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sResourceLoaderFromFile.kt @@ -19,11 +19,11 @@ class K8sResourceLoaderFromFile(private val client: NamespacedKubernetesClient): /** * Parses a Service from a service yaml - * @param path of the yaml file + * @param resource of the yaml file * @return Service from fabric8 */ - override fun loadService(path: String): Service { - return loadGenericResource(path) { x: String -> client.services().load(x).get() } + override fun loadService(resource: String): Service { + return loadGenericResource(resource) { x: String -> client.services().load(x).get() } } @@ -33,11 +33,11 @@ class K8sResourceLoaderFromFile(private val client: NamespacedKubernetesClient): * @param context specific crd context for this custom resource * @return CustomResourceWrapper from fabric8 */ - override fun loadCustomResourceWrapper(path: String, context: CustomResourceDefinitionContext): CustomResourceWrapper { - return loadGenericResource(path) { + override fun loadCustomResourceWrapper(resource: String, context: CustomResourceDefinitionContext): CustomResourceWrapper { + return loadGenericResource(resource) { CustomResourceWrapper( YamlParserFromFile().parse( - path, + resource, HashMap<String, String>()::class.java )!!, context @@ -47,29 +47,29 @@ class K8sResourceLoaderFromFile(private val client: NamespacedKubernetesClient): /** * Parses a Deployment from a Deployment yaml - * @param path of the yaml file + * @param resource of the yaml file * @return Deployment from fabric8 */ - override fun loadDeployment(path: String): Deployment { - return loadGenericResource(path) { x: String -> client.apps().deployments().load(x).get() } + override fun loadDeployment(resource: String): Deployment { + return loadGenericResource(resource) { x: String -> client.apps().deployments().load(x).get() } } /** * Parses a ConfigMap from a ConfigMap yaml - * @param path of the yaml file + * @param resource of the yaml file * @return ConfigMap from fabric8 */ - override fun loadConfigmap(path: String): ConfigMap { - return loadGenericResource(path) { x: String -> client.configMaps().load(x).get() } + override fun loadConfigmap(resource: String): ConfigMap { + return loadGenericResource(resource) { x: String -> client.configMaps().load(x).get() } } /** * Parses a StatefulSet from a StatefulSet yaml - * @param path of the yaml file + * @param resource of the yaml file * @return StatefulSet from fabric8 */ - override fun loadStatefulSet(path: String): KubernetesResource { - return loadGenericResource(path) { x: String -> client.apps().statefulSets().load(x).get() } + override fun loadStatefulSet(resource: String): KubernetesResource { + return loadGenericResource(resource) { x: String -> client.apps().statefulSets().load(x).get() } } } diff --git a/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sResourceLoaderFromString.kt b/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sResourceLoaderFromString.kt index 9ddf22119869ec56f093d264c4afb5347de851de..e9611aaa82870dfb676820029cf42c5aab63d672 100644 --- a/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sResourceLoaderFromString.kt +++ b/theodolite/src/main/kotlin/theodolite/k8s/resourceLoader/K8sResourceLoaderFromString.kt @@ -13,44 +13,44 @@ class K8sResourceLoaderFromString(private val client: NamespacedKubernetesClient K8sResourceLoader { @OptIn(ExperimentalStdlibApi::class) - override fun loadService(resourceStream: String): KubernetesResource { - return loadGenericResource(resourceStream) { x: String -> + override fun loadService(resource: String): KubernetesResource { + return loadGenericResource(resource) { x: String -> val stream = ByteArrayInputStream(x.encodeToByteArray()) client.services().load(stream).get() } } @OptIn(ExperimentalStdlibApi::class) - override fun loadDeployment(path: String): Deployment { - return loadGenericResource(path) { x: String -> + override fun loadDeployment(resource: String): Deployment { + return loadGenericResource(resource) { x: String -> val stream = ByteArrayInputStream(x.encodeToByteArray()) client.apps().deployments().load(stream).get() } } @OptIn(ExperimentalStdlibApi::class) - override fun loadConfigmap(path: String): ConfigMap { - return loadGenericResource(path) { x: String -> + override fun loadConfigmap(resource: String): ConfigMap { + return loadGenericResource(resource) { x: String -> val stream = ByteArrayInputStream(x.encodeToByteArray()) client.configMaps().load(stream).get() } } @OptIn(ExperimentalStdlibApi::class) - override fun loadStatefulSet(path: String): KubernetesResource { - return loadGenericResource(path) { x: String -> + override fun loadStatefulSet(resource: String): KubernetesResource { + return loadGenericResource(resource) { x: String -> val stream = ByteArrayInputStream(x.encodeToByteArray()) client.apps().statefulSets().load(stream).get() } } /** * Parses a CustomResource from a yaml - * @param path of the yaml file + * @param resource of the yaml file * @param context specific crd context for this custom resource * @return CustomResourceWrapper from fabric8 */ - override fun loadCustomResourceWrapper(path: String, context: CustomResourceDefinitionContext): CustomResourceWrapper { - return loadGenericResource(path) { + override fun loadCustomResourceWrapper(resource: String, context: CustomResourceDefinitionContext): CustomResourceWrapper { + return loadGenericResource(resource) { CustomResourceWrapper( YamlParserFromString().parse( - path, + resource, HashMap<String, String>()::class.java )!!, context diff --git a/theodolite/src/test/kotlin/theodolite/execution/operator/BenchmarkCRDummy.kt b/theodolite/src/test/kotlin/theodolite/execution/operator/BenchmarkCRDummy.kt index f3fd06a16e38439a2a694b415edc4d8b332ffd4d..24192282a7407daf60390660a5858e15640207f3 100644 --- a/theodolite/src/test/kotlin/theodolite/execution/operator/BenchmarkCRDummy.kt +++ b/theodolite/src/test/kotlin/theodolite/execution/operator/BenchmarkCRDummy.kt @@ -24,8 +24,9 @@ class BenchmarkCRDummy(name: String) { benchmarkCR.kind = "Benchmark" benchmarkCR.apiVersion = "v1" - benchmark.appResource = emptyList() - benchmark.loadGenResource = emptyList() + benchmark.appResourceSets = emptyList() + benchmark.loadGenResourceSets = emptyList() + benchmark.resourceTypes = emptyList() benchmark.loadTypes = emptyList() benchmark.kafkaConfig = kafkaConfig diff --git a/theodolite/src/test/kotlin/theodolite/execution/operator/ControllerTest.kt b/theodolite/src/test/kotlin/theodolite/execution/operator/ControllerTest.kt index 7ed868c7adc4afcd7a6a606d22124c92910ecd89..e40b37cfd849ac305fc7f1e03375d016cf7e57db 100644 --- a/theodolite/src/test/kotlin/theodolite/execution/operator/ControllerTest.kt +++ b/theodolite/src/test/kotlin/theodolite/execution/operator/ControllerTest.kt @@ -2,6 +2,7 @@ package theodolite.execution.operator import com.google.gson.Gson import com.google.gson.GsonBuilder +import io.fabric8.kubernetes.api.model.Service import io.fabric8.kubernetes.client.CustomResourceList import io.fabric8.kubernetes.client.server.mock.KubernetesServer import io.quarkus.test.junit.QuarkusTest @@ -146,13 +147,11 @@ class ControllerTest { ) method.isAccessible = true - this.benchmark.appResource = listOf("test-resource.yaml") - method.invoke( controller, "test-value", "test-name", - this.benchmark.appResource, + listOf("rest-resource.yaml"), this.execution ) as BenchmarkExecution?