Skip to content
Snippets Groups Projects

Draft: Rework state handling

Open Sören Henning requested to merge rework-state-handling into main
3 files
+ 34
5
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -17,7 +17,7 @@ abstract class AbstractStateHandler<S : HasMetadata>(
@@ -17,7 +17,7 @@ abstract class AbstractStateHandler<S : HasMetadata>(
private val crd: Class<S>
private val crd: Class<S>
) {
) {
private val crdClient: MixedOperation<S, KubernetesResourceList<S>, Resource<S>> = this.client.resources(this.crd)
protected val crdClient: MixedOperation<S, KubernetesResourceList<S>, Resource<S>> = this.client.resources(this.crd)
@Synchronized
@Synchronized
fun setState(resourceName: String, setter: (S) -> S?) {
fun setState(resourceName: String, setter: (S) -> S?) {
@@ -29,7 +29,8 @@ abstract class AbstractStateHandler<S : HasMetadata>(
@@ -29,7 +29,8 @@ abstract class AbstractStateHandler<S : HasMetadata>(
// find out the difference between patchStatus and replaceStatus
// find out the difference between patchStatus and replaceStatus
// see also https://github.com/fabric8io/kubernetes-client/pull/3798
// see also https://github.com/fabric8io/kubernetes-client/pull/3798
if (resourcePatched != null) {
if (resourcePatched != null) {
this.crdClient.withName(resourcePatched.metadata.name).patchStatus(resourcePatched)
//this.crdClient.withName(resourcePatched.metadata.name).patchStatus(resourcePatched)
 
this.client.resource(resourcePatched).patchStatus()
}
}
}
}
} catch (e: KubernetesClientException) {
} catch (e: KubernetesClientException) {
Loading