Skip to content
Snippets Groups Projects
Commit de0ad9f9 authored by Sören Henning's avatar Sören Henning
Browse files

Fix breaking changes in Kubernetes Client

parent 651f1a49
No related branches found
No related tags found
1 merge request!257Allow Theodolite to deploy arbitrary resources
Pipeline #7036 passed
......@@ -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})")
}
......
......@@ -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." }
......
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