diff --git a/docs/crd-docu.md b/docs/crd-docu.md index bb41474ce7891585bcd8203e839dec57fb50e873..ed569f7a7929a17193f29da5486de44b67fb297c 100644 --- a/docs/crd-docu.md +++ b/docs/crd-docu.md @@ -117,6 +117,8 @@ Resource Types: <td>string</td> <td> This field exists only for technical reasons and should not be set by the user. The value of the field will be overwritten.<br/> + <br/> + <i>Default</i>: <br/> </td> <td>false</td> </tr><tr> diff --git a/theodolite/crd/crd-benchmark.yaml b/theodolite/crd/crd-benchmark.yaml index d3c2716659e0707d619901481f79aefec2779b2e..5df23b6bf2746307876307c1b9234ac2ca4c7dae 100644 --- a/theodolite/crd/crd-benchmark.yaml +++ b/theodolite/crd/crd-benchmark.yaml @@ -25,6 +25,7 @@ spec: 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 + default: "" 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 diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt index cbdaab0d3158990ceff781045134638e8782989f..69eca6b6e3d038889a01723d281418fa0d6cd7b9 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt @@ -1,5 +1,6 @@ package theodolite.benchmark +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.fabric8.kubernetes.api.model.KubernetesResource import io.fabric8.kubernetes.client.DefaultKubernetesClient diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt b/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt index 19c0808093f6729978f98940641031d8e425c349..ba4dc3adbce5f123c924b118dbdaae1ed6beced0 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/ResourceSets.kt @@ -14,16 +14,18 @@ import theodolite.util.DeploymentFailedException @JsonInclude(JsonInclude.Include.NON_NULL) class ResourceSets: KubernetesResource { @JsonProperty("configMap") - lateinit var configMap: ConfigMapResourceSet + @JsonInclude(JsonInclude.Include.NON_NULL) + var configMap: ConfigMapResourceSet? = null @JsonProperty("fileSystem") - lateinit var fileSystem: FileSystemResourceSet + @JsonInclude(JsonInclude.Include.NON_NULL) + var fileSystem: FileSystemResourceSet? = null fun loadResourceSet(client: NamespacedKubernetesClient): Collection<Pair<String, KubernetesResource>> { - return if (::configMap.isInitialized) { - configMap.getResourceSet(client= client) - } else if (::fileSystem.isInitialized) { - fileSystem.getResourceSet(client= client ) + return if (::configMap != null) { + configMap?.getResourceSet(client= client) !! + } else if (::fileSystem != null) { + fileSystem?.getResourceSet(client= client ) !! } else { throw DeploymentFailedException("could not load resourceSet.") }