Skip to content

Commit

Permalink
bugfix_重新启用调度器 (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
h56983577 authored Nov 28, 2023
1 parent cfa61a7 commit 56078a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cn.edu.buaa.scs.kube

import cn.edu.buaa.scs.image.ImageBuildRoutine
import cn.edu.buaa.scs.utils.getConfigString
import cn.edu.buaa.scs.utils.logger
import com.fasterxml.jackson.module.kotlin.kotlinModule
Expand Down Expand Up @@ -33,7 +34,7 @@ fun Application.kubeModule() {
Serialization.jsonMapper().registerModules(kotlinModule(), KtormModule())

logger("kube")().info { "connected to official kubernetes apiserver successfully: ${kubeClient.kubernetesVersion.gitVersion}" }
// registerVirtualMachineOperator()
//
// ImageBuildRoutine.run()
registerVirtualMachineOperator()

ImageBuildRoutine.run()
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,14 @@ class VirtualMachineReconciler(val client: KubernetesClient) : Reconciler<Virtua
val vmClient = newVMClient(vm.spec.platform)
if (vm.spec.deleted) {
val exist = runBlocking {
if (vmClient.getVM(vm.status.uuid).isSuccess) {
vmClient.deleteVM(vm.status.uuid).getOrThrow()
true
} else {
try {
if (vmClient.getVM(vm.status.uuid).isSuccess) {
vmClient.deleteVM(vm.status.uuid).getOrThrow()
true
} else {
false
}
} catch (e: NullPointerException) {
false
}
}
Expand Down

0 comments on commit 56078a6

Please sign in to comment.