Skip to content
Snippets Groups Projects
Commit 6aeba702 authored by JustAnotherChristoph's avatar JustAnotherChristoph Committed by Christopher Konkel
Browse files

Now performing null check on fields appropriately

parent 53a214cb
No related branches found
No related tags found
1 merge request!269correct and test ResourceSets#loadResourceSet(..)
This commit is part of merge request !269. Comments created here will be created in the context of that merge request.
......@@ -11,7 +11,7 @@ import theodolite.util.DeploymentFailedException
@JsonDeserialize
@RegisterForReflection
class ResourceSets: KubernetesResource {
class ResourceSets : KubernetesResource {
@JsonProperty("configMap")
@JsonInclude(JsonInclude.Include.NON_NULL)
var configMap: ConfigMapResourceSet? = null
......@@ -21,13 +21,13 @@ class ResourceSets: KubernetesResource {
var fileSystem: FileSystemResourceSet? = null
fun loadResourceSet(client: NamespacedKubernetesClient): Collection<Pair<String, HasMetadata>> {
// TODO Find out whether field access (::configMap) is really what we want to do here (see #362)
return if (::configMap != null) {
configMap?.getResourceSet(client= client) !!
} else if (::fileSystem != null) {
fileSystem?.getResourceSet(client= client ) !!
} else {
throw DeploymentFailedException("Could not load resourceSet.")
}
return if (this.configMap != null) {
configMap?.getResourceSet(client = client)!!
} else if (this.fileSystem != null) {
fileSystem?.getResourceSet(client = client)!!
} else {
throw DeploymentFailedException("Could not load resourceSet.")
}
}
}
\ No newline at end of file
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