diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt b/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt index 966fa56329c8d7d466dd14858bcbc06bb5b857c3..a4345c43ac6a75667c3c3e85c8534697193e1458 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt @@ -7,7 +7,6 @@ import io.fabric8.kubernetes.client.dsl.ExecListener import io.fabric8.kubernetes.client.dsl.ExecWatch import io.fabric8.kubernetes.client.utils.Serialization import mu.KotlinLogging -import okhttp3.Response import theodolite.util.ActionCommandFailedException import theodolite.util.Configuration import java.io.ByteArrayOutputStream @@ -145,10 +144,8 @@ class ActionCommand(val client: NamespacedKubernetesClient) { } private class ActionCommandListener(val execLatch: CountDownLatch) : ExecListener { - override fun onOpen(response: Response) { - } - override fun onFailure(throwable: Throwable, response: Response) { + override fun onFailure(throwable: Throwable, response: ExecListener.Response) { execLatch.countDown() throw ActionCommandFailedException("Some error encountered while executing action, caused ${throwable.message})") } diff --git a/theodolite/src/main/kotlin/theodolite/execution/operator/AbstractStateHandler.kt b/theodolite/src/main/kotlin/theodolite/execution/operator/AbstractStateHandler.kt index 93536282e2eefe6e476c3fde3fd86860fa24dcc3..84343ea7e8d7d420bcf320f36be02c39c41a1945 100644 --- a/theodolite/src/main/kotlin/theodolite/execution/operator/AbstractStateHandler.kt +++ b/theodolite/src/main/kotlin/theodolite/execution/operator/AbstractStateHandler.kt @@ -25,7 +25,12 @@ abstract class AbstractStateHandler<S : HasMetadata>( val resource = this.crdClient.withName(resourceName).get() if (resource != null) { val resourcePatched = setter(resource) - this.crdClient.patchStatus(resourcePatched) + // TODO replace with this.crdClient.replaceStatus(resourcePatched) with upcoming fabric8 release (> 5.12.1) + // find out the difference between patchStatus and replaceStatus + // see also https://github.com/fabric8io/kubernetes-client/pull/3798 + if (resourcePatched != null) { + this.crdClient.withName(resourcePatched.metadata.name).patchStatus(resourcePatched) + } } } catch (e: KubernetesClientException) { logger.warn(e) { "Status cannot be set for resource $resourceName." }