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

fix non null problems iff name is not set

parent 68b4b76b
No related branches found
No related tags found
1 merge request!176Add a Benchmark Status
......@@ -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>
......
......@@ -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
......
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
......
......@@ -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.")
}
......
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