Skip to content
Snippets Groups Projects
Commit 2346744e authored by Lorenz Boguhn's avatar Lorenz Boguhn
Browse files

Add deploy and delete to ServiceManager + Refactoring

parent 35579558
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus,!78Resolve "Implement Quarkus/Kotlin protype"
...@@ -48,7 +48,7 @@ class DeploymentManager { ...@@ -48,7 +48,7 @@ class DeploymentManager {
Thread.sleep(Duration(java.time.Duration.ofSeconds(30)).duration.toMillis()) Thread.sleep(Duration(java.time.Duration.ofSeconds(30)).duration.toMillis())
logger.info { "will delete workload now!" } logger.info { "will delete workload now!" }
delete(workload) delete(workload)
logger.info { "workld deletet" } logger.info { "workload deletet" }
// logger.debug(config.toString()) // logger.debug(config.toString())
......
package theodolite package theodolite
import io.fabric8.kubernetes.api.model.Service import io.fabric8.kubernetes.api.model.Service
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
class ServiceManager(client: NamespacedKubernetesClient) {
lateinit var client: NamespacedKubernetesClient
init {
this.client = client
}
class ServiceManager {
fun changeServiceName(service: Service, newName: String) { fun changeServiceName(service: Service, newName: String) {
service.metadata.apply { service.metadata.apply {
name = newName name = newName
} }
} }
fun deploy(service: Service) {
client.services().create(service)
}
fun delete(service: Service) {
client.services().delete(service)
}
} }
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