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

Generalize the loading of k8s resources

parent 589f10de
No related branches found
No related tags found
1 merge request!171Introduce ResourceSets to make loading of resource files more flexible
Showing
with 281 additions and 120 deletions
......@@ -5,9 +5,8 @@ import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import mu.KotlinLogging
import theodolite.k8s.K8sResourceLoaderFromString
import theodolite.k8s.resourceLoader.K8sResourceLoaderFromString
import theodolite.util.YamlParserFromString
import kotlin.math.log
private val logger = KotlinLogging.logger {}
......
......@@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.client.DefaultKubernetesClient
import mu.KotlinLogging
import theodolite.k8s.K8sResourceLoader
import theodolite.k8s.resourceLoader.K8sResourceLoaderFromFile
import theodolite.util.DeploymentFailedException
import theodolite.util.YamlParserFromFile
import java.io.File
......@@ -17,7 +17,7 @@ class FileSystemResourceSet: ResourceSet {
lateinit var path: String
lateinit var files: List<String>
private val parser = YamlParserFromFile()
private val loader = K8sResourceLoader(DefaultKubernetesClient().inNamespace("default")) // TODO(set namespace correctly)
private val loader = K8sResourceLoaderFromFile(DefaultKubernetesClient().inNamespace("default")) // TODO(set namespace correctly)
override fun getResourceSet(): List<Pair<String, KubernetesResource>> {
logger.info { "Get fileSystem resource set $path" }
......
......@@ -5,7 +5,7 @@ import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.quarkus.runtime.annotations.RegisterForReflection
import mu.KotlinLogging
import theodolite.k8s.K8sResourceLoader
import theodolite.k8s.resourceLoader.K8sResourceLoader
import theodolite.patcher.PatcherFactory
import theodolite.util.*
......
......@@ -4,11 +4,8 @@ import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import io.quarkus.runtime.annotations.RegisterForReflection
import mu.KotlinLogging
import theodolite.k8s.K8sResourceLoaderFromString
import theodolite.util.DeploymentFailedException
private val logger = KotlinLogging.logger {}
......
package theodolite.k8s
abstract class AbstractK8sLoader {
}
\ No newline at end of file
package theodolite.k8s
import io.fabric8.kubernetes.api.model.ConfigMap
import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.api.model.Service
import io.fabric8.kubernetes.api.model.apps.Deployment
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import io.fabric8.kubernetes.client.utils.Serialization
import mu.KotlinLogging
import theodolite.util.YamlParserFromString
import java.io.ByteArrayInputStream
private val logger = KotlinLogging.logger {}
class K8sResourceLoaderFromString(private val client: NamespacedKubernetesClient) {
@OptIn(ExperimentalStdlibApi::class)
fun loadK8sResource(kind: String, resourceString: String): KubernetesResource {
return when (kind) {
"Deployment" -> loadDeployment(resourceString)
"Service" -> loadService(resourceString)
//"ServiceMonitor" -> loadServiceMonitor(resourceString) // TODO(Add support for custom resources)
"ConfigMap" -> loadConfigmap(resourceString)
"StatefulSet" -> loadStatefulSet(resourceString)
//"Execution" -> loadExecution(resourceString)
//"Benchmark" -> loadBenchmark(resourceString)
else -> {
logger.error { "Error during loading of unspecified resource Kind" }
throw java.lang.IllegalArgumentException("error while loading resource with kind: $kind")
}
}
}
/**
* Generic helper function to load a resource.
* @param path of the resource
* @param f function that is applied to the resource.
* @throws IllegalArgumentException If the resource could not be loaded.
*/
@OptIn(ExperimentalStdlibApi::class)
private fun <T> loadGenericResource(resourceString: String, f: (ByteArrayInputStream) -> T): T {
val stream = ByteArrayInputStream(resourceString.encodeToByteArray())
var resource: T? = null
try {
resource = f(stream)
} catch (e: Exception) {
logger.warn { "You potentially misspelled the path: ....1" }
logger.warn { e }
}
if (resource == null) {
throw IllegalArgumentException("The Resource: ....1 could not be loaded")
}
return resource
}
@OptIn(ExperimentalStdlibApi::class)
private fun loadService(resourceStream: String): KubernetesResource {
//logger.info { resourceStream }
val stream = ByteArrayInputStream(resourceStream.encodeToByteArray())
//val test = Serialization.unmarshal<Service>(stream, Service::class.java)
//logger.info { test }
// return test
logger.info { "Test" }
//val parser = YamlParserFromString()
//val resoureceAsMap = parser.parse(resourceStream, HashMap<String, String>()::class.java)
//val loadedSvc: Service = client.services().load(stream).get()
//logger.info { "loadedSvc" }
//return loadedSvc
//logger.info { "try to load service" }
return loadGenericResource(resourceStream) { x: ByteArrayInputStream -> client.services().load(x).get() }
}
private fun loadDeployment(path: String): Deployment {
return loadGenericResource(path) { x: ByteArrayInputStream -> client.apps().deployments().load(x).get() }
}
private fun loadConfigmap(path: String): ConfigMap {
return loadGenericResource(path) { x: ByteArrayInputStream -> client.configMaps().load(x).get() }
}
private fun loadStatefulSet(path: String): KubernetesResource {
return loadGenericResource(path) { x: ByteArrayInputStream -> client.apps().statefulSets().load(x).get() }
}
}
\ No newline at end of file
package theodolite.k8s.resourceLoader
import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext
import mu.KotlinLogging
import theodolite.k8s.K8sContextFactory
private val logger = KotlinLogging.logger {}
abstract class AbstractK8sLoader: K8sResourceLoader {
abstract fun loadCustomResourceWrapper(path: String, context: CustomResourceDefinitionContext): KubernetesResource
fun loadK8sResource(kind: String, resourceString: String): KubernetesResource {
return when (kind) {
"Deployment" -> loadDeployment(resourceString)
"Service" -> loadService(resourceString)
"ServiceMonitor" -> loadServiceMonitor(resourceString)
"ConfigMap" -> loadConfigmap(resourceString)
"StatefulSet" -> loadStatefulSet(resourceString)
"Execution" -> loadExecution(resourceString)
"Benchmark" -> loadBenchmark(resourceString)
else -> {
logger.error { "Error during loading of unspecified resource Kind" }
throw java.lang.IllegalArgumentException("error while loading resource with kind: $kind")
}
}
}
fun <T> loadGenericResource(resourceString: String, f: (String) -> T): T {
var resource: T? = null
try {
resource = f(resourceString)
} catch (e: Exception) {
logger.warn { "You potentially misspelled the path: ....1" }
logger.warn { e }
}
if (resource == null) {
throw IllegalArgumentException("The Resource: ....1 could not be loaded")
}
return resource
}
override fun loadServiceMonitor(path: String): KubernetesResource {
val context = K8sContextFactory().create(
api = "v1",
scope = "Namespaced",
group = "monitoring.coreos.com",
plural = "servicemonitors"
)
return loadCustomResourceWrapper(path, context)
}
override fun loadExecution(path: String): KubernetesResource {
val context = K8sContextFactory().create(
api = "v1",
scope = "Namespaced",
group = "theodolite.com",
plural = "executions"
)
return loadCustomResourceWrapper(path, context)
}
override fun loadBenchmark(path: String): KubernetesResource {
val context = K8sContextFactory().create(
api = "v1",
scope = "Namespaced",
group = "theodolite.com",
plural = "benchmarks"
)
return loadCustomResourceWrapper(path, context)
}
}
\ No newline at end of file
package theodolite.k8s.resourceLoader
import io.fabric8.kubernetes.api.model.KubernetesResource
interface K8sResourceLoader {
fun loadDeployment(resource: String): KubernetesResource
fun loadService(resource: String): KubernetesResource
fun loadStatefulSet(resource: String): KubernetesResource
fun loadExecution(resource: String): KubernetesResource
fun loadBenchmark(resource: String): KubernetesResource
fun loadConfigmap(resource: String): KubernetesResource
fun loadServiceMonitor(resource: String): KubernetesResource
}
\ No newline at end of file
package theodolite.k8s
package theodolite.k8s.resourceLoader
import io.fabric8.kubernetes.api.model.ConfigMap
import io.fabric8.kubernetes.api.model.KubernetesResource
......@@ -6,24 +6,23 @@ import io.fabric8.kubernetes.api.model.Service
import io.fabric8.kubernetes.api.model.apps.Deployment
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext
import mu.KotlinLogging
import theodolite.k8s.CustomResourceWrapper
import theodolite.util.YamlParserFromFile
private val logger = KotlinLogging.logger {}
/**
* Used to load different Kubernetes resources.
* Supports: Deployments, Services, ConfigMaps, and CustomResources.
* @param client KubernetesClient used to deploy or remove.
*/
class K8sResourceLoader(private val client: NamespacedKubernetesClient) {
class K8sResourceLoaderFromFile(private val client: NamespacedKubernetesClient): AbstractK8sLoader(),
K8sResourceLoader {
/**
* Parses a Service from a service yaml
* @param path of the yaml file
* @return Service from fabric8
*/
private fun loadService(path: String): Service {
override fun loadService(path: String): Service {
return loadGenericResource(path) { x: String -> client.services().load(x).get() }
}
......@@ -34,7 +33,7 @@ class K8sResourceLoader(private val client: NamespacedKubernetesClient) {
* @param context specific crd context for this custom resource
* @return CustomResourceWrapper from fabric8
*/
private fun loadCustomResourceWrapper(path: String, context: CustomResourceDefinitionContext): CustomResourceWrapper {
override fun loadCustomResourceWrapper(path: String, context: CustomResourceDefinitionContext): CustomResourceWrapper {
return loadGenericResource(path) {
CustomResourceWrapper(
YamlParserFromFile().parse(
......@@ -46,43 +45,12 @@ class K8sResourceLoader(private val client: NamespacedKubernetesClient) {
}
}
private fun loadServiceMonitor(path: String): CustomResourceWrapper {
val context = K8sContextFactory().create(
api = "v1",
scope = "Namespaced",
group = "monitoring.coreos.com",
plural = "servicemonitors"
)
return loadCustomResourceWrapper(path, context)
}
private fun loadExecution(path: String): KubernetesResource {
val context = K8sContextFactory().create(
api = "v1",
scope = "Namespaced",
group = "theodolite.com",
plural = "executions"
)
return loadCustomResourceWrapper(path, context)
}
private fun loadBenchmark(path: String): KubernetesResource {
val context = K8sContextFactory().create(
api = "v1",
scope = "Namespaced",
group = "theodolite.com",
plural = "benchmarks"
)
return loadCustomResourceWrapper(path, context)
}
/**
* Parses a Deployment from a Deployment yaml
* @param path of the yaml file
* @return Deployment from fabric8
*/
private fun loadDeployment(path: String): Deployment {
override fun loadDeployment(path: String): Deployment {
return loadGenericResource(path) { x: String -> client.apps().deployments().load(x).get() }
}
......@@ -91,7 +59,7 @@ class K8sResourceLoader(private val client: NamespacedKubernetesClient) {
* @param path of the yaml file
* @return ConfigMap from fabric8
*/
private fun loadConfigmap(path: String): ConfigMap {
override fun loadConfigmap(path: String): ConfigMap {
return loadGenericResource(path) { x: String -> client.configMaps().load(x).get() }
}
......@@ -100,54 +68,8 @@ class K8sResourceLoader(private val client: NamespacedKubernetesClient) {
* @param path of the yaml file
* @return StatefulSet from fabric8
*/
private fun loadStatefulSet(path: String): KubernetesResource {
override fun loadStatefulSet(path: String): KubernetesResource {
return loadGenericResource(path) { x: String -> client.apps().statefulSets().load(x).get() }
}
/**
* Generic helper function to load a resource.
* @param path of the resource
* @param f function that is applied to the resource.
* @throws IllegalArgumentException If the resource could not be loaded.
*/
private fun <T> loadGenericResource(path: String, f: (String) -> T): T {
var resource: T? = null
try {
resource = f(path)
} catch (e: Exception) {
logger.warn { "You potentially misspelled the path: $path" }
logger.warn { e }
}
if (resource == null) {
throw IllegalArgumentException("The Resource at path: $path could not be loaded")
}
return resource
}
/**
* Factory function used to load different k8s resources from a path.
* Supported kinds are: Deployments, Services, ServiceMonitors, ConfigMaps and CustomResources.
* Uses CustomResource as default if Kind is not supported.
* @param kind of the resource. CustomResource as default.
* @param path of the resource to be loaded.
* @throws Exception if the resource could not be loaded.
*/
fun loadK8sResource(kind: String, path: String): KubernetesResource {
return when (kind) {
"Deployment" -> loadDeployment(path)
"Service" -> loadService(path)
"ServiceMonitor" -> loadServiceMonitor(path)
"ConfigMap" -> loadConfigmap(path)
"StatefulSet" -> loadStatefulSet(path)
"Execution" -> loadExecution(path)
"Benchmark" -> loadBenchmark(path)
else -> {
logger.error { "Error during loading of unspecified resource Kind" }
throw java.lang.IllegalArgumentException("error while loading resource with kind: $kind")
}
}
}
}
package theodolite.k8s.resourceLoader
import io.fabric8.kubernetes.api.model.ConfigMap
import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.api.model.apps.Deployment
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext
import theodolite.k8s.CustomResourceWrapper
import theodolite.util.YamlParserFromString
import java.io.ByteArrayInputStream
class K8sResourceLoaderFromString(private val client: NamespacedKubernetesClient): AbstractK8sLoader(),
K8sResourceLoader {
@OptIn(ExperimentalStdlibApi::class)
override fun loadService(resourceStream: String): KubernetesResource {
return loadGenericResource(resourceStream) { 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 ->
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 ->
val stream = ByteArrayInputStream(x.encodeToByteArray())
client.configMaps().load(stream).get() }
}
@OptIn(ExperimentalStdlibApi::class)
override fun loadStatefulSet(path: String): KubernetesResource {
return loadGenericResource(path) { 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 context specific crd context for this custom resource
* @return CustomResourceWrapper from fabric8
*/
override fun loadCustomResourceWrapper(path: String, context: CustomResourceDefinitionContext): CustomResourceWrapper {
return loadGenericResource(path) {
CustomResourceWrapper(
YamlParserFromString().parse(
path,
HashMap<String, String>()::class.java
)!!,
context
)
}
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.quarkus.test.junit.QuarkusTest
import io.smallrye.common.constraint.Assert.assertTrue
import org.junit.jupiter.api.Test
import theodolite.k8s.K8sResourceLoader
import theodolite.k8s.resourceLoader.K8sResourceLoaderFromFile
import theodolite.patcher.PatcherFactory
import theodolite.util.PatcherDefinition
......@@ -22,7 +22,7 @@ import theodolite.util.PatcherDefinition
@QuarkusTest
class ResourceLimitPatcherTest {
val testPath = "./src/test/resources/"
val loader = K8sResourceLoader(DefaultKubernetesClient().inNamespace(""))
val loader = K8sResourceLoaderFromFile(DefaultKubernetesClient().inNamespace(""))
val patcherFactory = PatcherFactory()
fun applyTest(fileName: String) {
......
......@@ -5,7 +5,7 @@ import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.quarkus.test.junit.QuarkusTest
import io.smallrye.common.constraint.Assert.assertTrue
import org.junit.jupiter.api.Test
import theodolite.k8s.K8sResourceLoader
import theodolite.k8s.resourceLoader.K8sResourceLoaderFromFile
import theodolite.patcher.PatcherFactory
import theodolite.util.PatcherDefinition
......@@ -22,7 +22,7 @@ import theodolite.util.PatcherDefinition
@QuarkusTest
class ResourceRequestPatcherTest {
val testPath = "./src/test/resources/"
val loader = K8sResourceLoader(DefaultKubernetesClient().inNamespace(""))
val loader = K8sResourceLoaderFromFile(DefaultKubernetesClient().inNamespace(""))
val patcherFactory = PatcherFactory()
fun applyTest(fileName: String) {
......
......@@ -10,7 +10,7 @@ import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import theodolite.k8s.K8sManager
import theodolite.k8s.K8sResourceLoader
import theodolite.k8s.resourceLoader.K8sResourceLoaderFromFile
import theodolite.model.crd.States
import java.lang.Thread.sleep
......@@ -42,10 +42,10 @@ class ExecutionEventHandlerTest {
this.factory = operator.getExecutionEventHandler(this.controller,server.client)
this.stateHandler = TheodoliteOperator().getExecutionStateHandler(client = server.client)
this.executionVersion1 = K8sResourceLoader(server.client)
this.executionVersion1 = K8sResourceLoaderFromFile(server.client)
.loadK8sResource("Execution", testResourcePath + "test-execution.yaml")
this.executionVersion2 = K8sResourceLoader(server.client)
this.executionVersion2 = K8sResourceLoaderFromFile(server.client)
.loadK8sResource("Execution", testResourcePath + "test-execution-update.yaml")
this.stateHandler = operator.getExecutionStateHandler(server.client)
......
......@@ -8,7 +8,7 @@ import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import theodolite.k8s.K8sManager
import theodolite.k8s.K8sResourceLoader
import theodolite.k8s.resourceLoader.K8sResourceLoaderFromFile
import theodolite.model.crd.States
import java.time.Duration
......@@ -19,7 +19,7 @@ class StateHandlerTest {
@BeforeEach
fun setUp() {
server.before()
val executionResource = K8sResourceLoader(server.client)
val executionResource = K8sResourceLoaderFromFile(server.client)
.loadK8sResource("Execution", testResourcePath + "test-execution.yaml")
K8sManager(server.client).deploy(executionResource)
......
package theodolite.execution.operator
import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.quarkus.test.junit.QuarkusTest
import mu.KotlinLogging
import org.junit.jupiter.api.Test
private val logger = KotlinLogging.logger {}
@QuarkusTest
class testTest {
@Test
fun test(){
val operator = TheodoliteOperator()
val client = DefaultKubernetesClient().inNamespace("default")
val benchmarkClient = operator.getBenchmarkClient(client = client)
val benchmarks = benchmarkClient
.list()
.items
val r = benchmarks.map{
it.spec.loadKubernetesResources(it.spec.loadGenResourceSets)
}
r.forEach {
it?.forEach{
logger.info { it }
}
}
}
}
\ No newline at end of file
......@@ -15,6 +15,7 @@ import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import theodolite.k8s.resourceLoader.K8sResourceLoaderFromFile
private val logger = KotlinLogging.logger {}
......@@ -125,7 +126,7 @@ class K8sManagerTest {
@DisplayName("Test handling of custom resources")
fun handleCustomResourcesTest() {
val manager = K8sManager(server.client)
val servicemonitor = K8sResourceLoader(server.client)
val servicemonitor = K8sResourceLoaderFromFile(server.client)
.loadK8sResource("ServiceMonitor", testResourcePath + "test-service-monitor.yaml")
val serviceMonitorContext = K8sContextFactory().create(
......
......@@ -12,6 +12,7 @@ import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import theodolite.k8s.resourceLoader.K8sResourceLoaderFromFile
@QuarkusTest
class K8sResourceLoaderTest {
......@@ -31,7 +32,7 @@ class K8sResourceLoaderTest {
@Test
@DisplayName("Test loading of Deployments")
fun loadDeploymentTest() {
val loader = K8sResourceLoader(server.client)
val loader = K8sResourceLoaderFromFile(server.client)
val resource = loader.loadK8sResource("Deployment", testResourcePath + "test-deployment.yaml")
assertTrue(resource is Deployment)
......@@ -41,7 +42,7 @@ class K8sResourceLoaderTest {
@Test
@DisplayName("Test loading of StatefulSet")
fun loadStatefulSetTest() {
val loader = K8sResourceLoader(server.client)
val loader = K8sResourceLoaderFromFile(server.client)
val resource = loader.loadK8sResource("StatefulSet", testResourcePath + "test-statefulset.yaml")
assertTrue(resource is StatefulSet)
......@@ -51,7 +52,7 @@ class K8sResourceLoaderTest {
@Test
@DisplayName("Test loading of Service")
fun loadServiceTest() {
val loader = K8sResourceLoader(server.client)
val loader = K8sResourceLoaderFromFile(server.client)
val resource = loader.loadK8sResource("Service", testResourcePath + "test-service.yaml")
assertTrue(resource is Service)
......@@ -61,7 +62,7 @@ class K8sResourceLoaderTest {
@Test
@DisplayName("Test loading of ConfigMap")
fun loadConfigMapTest() {
val loader = K8sResourceLoader(server.client)
val loader = K8sResourceLoaderFromFile(server.client)
val resource = loader.loadK8sResource("ConfigMap", testResourcePath + "test-configmap.yaml")
assertTrue(resource is ConfigMap)
......@@ -71,7 +72,7 @@ class K8sResourceLoaderTest {
@Test
@DisplayName("Test loading of ServiceMonitors")
fun loadServiceMonitorTest() {
val loader = K8sResourceLoader(server.client)
val loader = K8sResourceLoaderFromFile(server.client)
val resource = loader.loadK8sResource("ServiceMonitor", testResourcePath + "test-service-monitor.yaml")
assertTrue(resource is CustomResourceWrapper)
......@@ -84,7 +85,7 @@ class K8sResourceLoaderTest {
@Test
@DisplayName("Test loading of Executions")
fun loadExecutionTest() {
val loader = K8sResourceLoader(server.client)
val loader = K8sResourceLoaderFromFile(server.client)
val resource = loader.loadK8sResource("Execution", testResourcePath + "test-execution.yaml")
assertTrue(resource is CustomResourceWrapper)
......@@ -97,7 +98,7 @@ class K8sResourceLoaderTest {
@Test
@DisplayName("Test loading of Benchmarks")
fun loadBenchmarkTest() {
val loader = K8sResourceLoader(server.client)
val loader = K8sResourceLoaderFromFile(server.client)
val resource = loader.loadK8sResource("Benchmark", testResourcePath + "test-benchmark.yaml")
assertTrue(resource is CustomResourceWrapper)
......
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