Skip to content
Snippets Groups Projects
Commit 7448d5ae authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

update crd schemata, minor code changes

parent 1f7e2ccb
No related branches found
No related tags found
1 merge request!171Introduce ResourceSets to make loading of resource files more flexible
......@@ -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:
......
......@@ -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
......
......@@ -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 {
......
......@@ -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>> {
......
......@@ -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)) {
......
......@@ -226,7 +226,6 @@ class ConfigMapResourceSetTest {
try {
resourceSet.getResourceSet(server.client)
} catch (e: Exception) {
println( "haha " + e)
ex = e
}
assertTrue(ex is DeploymentFailedException)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment